Tomato6966/discord-leveling-system-ranking-system

Leaderboard undefined bug

Closed this issue · 5 comments

When a user talks, he is given some points in the database and added to the lederboard, but when he leaves the server, his points still stay in the leaderboard but name changes to undefined :/
image
anyway how to fix that / delete the user's points as soon as he leaves the server?

I Have tried adding this but doesn't seem to function...

bot.on('guildMemberLeave', async (member) => {
    bot.points.delete(`${member.guild.id}-${member.user.id}`)
  })

dead project

@BlackKnight683 if you know discord.js client events you just should do:

bot.on('guildMemberRemove', (member) => {
    bot.points.delete(`${member.guild.id}-${member.user.id}`)
  }) 

as your given Event is not existing, and sorry for not answering ... i didnt got notified

Well.. apparently not a dead project. my apologies