1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-02 16:43:12 +00:00

Ensure that there is always a multiplier set

This commit is contained in:
Atmois 2024-09-30 18:35:05 +01:00
parent ffc3f19719
commit c73c10d05c
No known key found for this signature in database
GPG key ID: 6185A6C848415331

View file

@ -191,11 +191,13 @@ class LevelsController:
if await self.is_blacklisted(user_id, guild_id):
return
multiplier = 1.0
multiplier = 1
for role in member.roles:
if role.id in self.xp_multipliers:
multiplier = max(multiplier, self.xp_multipliers[role.id])
else:
multiplier = 1
xp_increment = 1 * multiplier
await db.levels.update(
where={"user_id_guild_id": {"user_id": user_id, "guild_id": guild_id}},