fix(command): rank for member not working

This commit is contained in:
Anhgelus Morhtuuzh 2024-06-11 21:04:09 +02:00
parent c19bbf1d1e
commit d485b0de1c
Signed by: anhgelus
GPG key ID: CAD341EFA92DDDE5

View file

@ -39,20 +39,8 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
}
return
}
c.DiscordID = u.ID // current copaing = member targeted by member who wrote /rank
err = c.Load() // reload copaing (change line before)
if err != nil {
utils.SendAlert(
"commands/rank.go - Loading copaing",
err.Error(),
"discord_id",
u.ID,
"guild_id",
i.GuildID,
)
return
}
xp.XPUpdate(s, c) // update xp without resetting event
c = xp.GetCopaing(u.ID, i.GuildID) // current copaing = member targeted by member who wrote /rank
xp.XPUpdate(s, c) // update xp without resetting event
msg = fmt.Sprintf("Le niveau de %s", m.DisplayName())
}
lvl := xp.Level(c.XP)