Defxult / discordLevelingSystem

A library to implement a leveling system into a discord bot. Contains features such as XP, level, ranks, and role awards.
MIT License
91 stars 17 forks source link

add_xp() doesn't add to member_xp but only to member_total_xp #18

Closed Paillat-dev closed 1 year ago

Paillat-dev commented 1 year ago

Describe the bug When doing add_xp() the xp is added only to the user's total xp and the current xp is not updated. When I consult the database I can see that lxp is added but only to the total xp.

To Reproduce Minimal code to reproduce the bug/error

import discord
from discordLevelingSystem import DiscordLevelingSystem, RoleAward, LevelUpAnnouncement
lvl = DiscordLevelingSystem(level_up_announcement=announcement, no_xp_channels=[1022441601420759100])
announcement = LevelUpAnnouncement(f'{LevelUpAnnouncement.Member.mention} just leveled up to level {LevelUpAnnouncement.LEVEL} 😎')
lvl.connect_to_database_file(r'database path')
bot = discord.Bot(intents=discord.Intents(messages=True, guilds=True, members=True))
@bot.event
async def on_voice_state_update(member, before, after):
  print("Voice state updated")
  if before.channel is None and after.channel is not None:
    print("User joined a voice channel")
    await lvl.add_xp(member, 20)
    print("20 xp added to user")
    print(member)

Traceback if any

N/A

Required Checklist

Version Info What's the exact version of discordLevelingSystem/discord.py are you using?

Defxult commented 1 year ago

There is no discord.py 2.1.3...Could've just left your edit as is letting me know you tested it on py-cord and discord.py, but I had to go through all of your edited messages to make sure I'm not crazy...smh...

Anyways, when testing the library a just a few days for a new feature I recognized that issue and it will be fixed soon after that new feature is implemented. Thanks for creating the issue anyway though!

Edit: Not sure if I want to change it because that's how its been for a while. Closing for now, might change in the future.

Paillat-dev commented 1 year ago

Ok, but is there any way to add xp to the current xp?