mirror of
https://github.com/Lilac-Rose/Lacie.git
synced 2026-09-07 16:45:54 -05:00
Made it so annual and lifetime xp are the same number instead of being generated twice per message for each db
This commit is contained in:
@@ -11,6 +11,8 @@ async def add_xp(member):
|
||||
if is_channel_excluded(last_message.channel.id):
|
||||
return
|
||||
|
||||
base_xp = random_xp()
|
||||
|
||||
for lifetime in (True, False): # True = lifetime, False = annual
|
||||
conn, cur = get_db(lifetime)
|
||||
cur.execute("SELECT xp, level, last_message FROM xp WHERE user_id = ?", (str(member.id),))
|
||||
@@ -29,7 +31,7 @@ async def add_xp(member):
|
||||
)
|
||||
|
||||
# Only apply multiplier for lifetime XP
|
||||
gained = int(random_xp() * get_multiplier(member, apply_multiplier=lifetime))
|
||||
gained = int(base_xp * get_multiplier(member, apply_multiplier=lifetime))
|
||||
new_xp = xp + gained
|
||||
|
||||
cur.execute(
|
||||
|
||||
Reference in New Issue
Block a user