aboutsummaryrefslogtreecommitdiff
path: root/commands/rank.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/rank.go')
-rw-r--r--commands/rank.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/commands/rank.go b/commands/rank.go
index 219977d..2d15f6f 100644
--- a/commands/rank.go
+++ b/commands/rank.go
@@ -40,8 +40,19 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
return
}
c.DiscordID = u.ID // current copaing = member targeted by member who wrote /rank
- c.Load() // reload copaing (change line before)
- xp.XPUpdate(s, c) // update xp without resetting event
+ 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
msg = fmt.Sprintf("Le niveau de %s", m.DisplayName())
}
lvl := xp.Level(c.XP)