aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-06-11 21:04:09 +0200
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-06-11 21:04:09 +0200
commitd485b0de1ce170aa18b09b6654a607a7f04f0315 (patch)
tree3036406f0774cb78edef2d48af42c35801d2fdce /commands
parentc19bbf1d1e22d094e6ecc57b2f7ef926806392c3 (diff)
fix(command): rank for member not working
Diffstat (limited to 'commands')
-rw-r--r--commands/rank.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/commands/rank.go b/commands/rank.go
index 2d15f6f..4d6f817 100644
--- a/commands/rank.go
+++ b/commands/rank.go
@@ -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)