diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-18 12:32:29 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-18 12:32:29 +0200 |
| commit | 1f5c649169591472572cb2874d2e70eb96ca7896 (patch) | |
| tree | 6190ce0c5da1bb99c53863cafba673dc8247cb49 /commands/rank.go | |
| parent | 18fec5a866e82aea1be4829b5cd0e03a06b04223 (diff) | |
feat(deps): update to gokord v0.3.0
Diffstat (limited to 'commands/rank.go')
| -rw-r--r-- | commands/rank.go | 15 |
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) |
