diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 19:30:02 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 19:30:02 +0200 |
| commit | e78c8d8c422bf470924109c186cff9f987b095fd (patch) | |
| tree | 1373989a01e7de99208f09519b9ef06059dcd4c4 /commands | |
| parent | 9f9c27f42298d51a356743724095a6dd79196dfe (diff) | |
fix(command): /rank prochain niveau not working
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/rank.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/commands/rank.go b/commands/rank.go index ecf9a08..fe05ba8 100644 --- a/commands/rank.go +++ b/commands/rank.go @@ -9,8 +9,8 @@ import ( func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) { optMap := utils.GenerateOptionMap(i) - c := xp.GetCopaing(i.User.ID, i.GuildID) // current copaing = member who used /rank - xp.LastEventUpdate(c) // update xp and reset last event + c := xp.GetCopaing(i.Member.User.ID, i.GuildID) // current copaing = member who used /rank + xp.LastEventUpdate(c) // update xp and reset last event msg := "Votre niveau" m := i.Member var err error @@ -45,13 +45,13 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) { msg = fmt.Sprintf("Le niveau de %s", m.DisplayName()) } lvl := xp.Level(c.XP) - nxtLvl := xp.XPForLevel(lvl + 1) + nxtLvlXP := xp.XPForLevel(lvl + 1) err = resp.Message(fmt.Sprintf( "%s : **%d**\n> XP : %d\n> Prochain niveau dans %d XP", msg, lvl, c.XP, - nxtLvl-lvl, + nxtLvlXP-xp.XPForLevel(lvl), )).Send() if err != nil { utils.SendAlert("rank.go - Sending rank", err.Error()) |
