Skip to content

Commit

Permalink
⚡ Replace Double XP with Levelling Multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
tookender committed May 30, 2024
1 parent 8296765 commit 975e39b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions extensions/levelling/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ async def levelling(self, message: discord.Message):
# Amount of XP the user should get for the message
random_xp = random.randint(24, 34) + (random.randint(4, 7) if len(message.content) > random.randint(34, 44) else 0)

double_xp = await self.bot.pool.fetchval("SELECT levelling_double_xp FROM guilds WHERE guild_id = $1", message.guild.id)
if double_xp:
random_xp = random_xp * 2
multiplier = await self.bot.pool.fetchval("SELECT levelling_multiplier FROM guilds WHERE guild_id = $1", message.guild.id)
random_xp = random_xp * multiplier

data = await self.bot.pool.fetchrow(
"SELECT level, xp FROM levels WHERE guild_id = $1 AND user_id = $2",
Expand Down

0 comments on commit 975e39b

Please sign in to comment.