aboutsummaryrefslogtreecommitdiff
path: root/commands/rank.go
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2026-01-17 21:50:54 +0100
committerWilliam Hergès <william@herges.fr>2026-01-17 21:50:54 +0100
commitc661541e45dddd6a082af66fcf7df7ba7dfdc6a6 (patch)
tree318b29652c4f59a7f6a16ff7a566b1a9935d069d /commands/rank.go
parentec5cfa632eeb607351f67bad6686ec872291bd61 (diff)
perf(command): store data used by top in state
Diffstat (limited to 'commands/rank.go')
-rw-r--r--commands/rank.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/commands/rank.go b/commands/rank.go
index c65c758..3a017f6 100644
--- a/commands/rank.go
+++ b/commands/rank.go
@@ -38,15 +38,12 @@ func Rank(ctx context.Context) func(s bot.Session, i *event.InteractionCreate, o
c = user.GetCopaing(ctx, u.ID, i.GuildID) // current user = member targeted by member who wrote /rank
msg = fmt.Sprintf("Le niveau de %s", m.DisplayName())
}
- xp := c.XPs
+ xp := c.XP
lvl := exp.Level(xp)
nxtLvlXP := exp.LevelXP(lvl + 1)
err = resp.SetMessage(fmt.Sprintf(
"%s : **%d**\n> XP : %d\n> Prochain niveau dans %d XP",
- msg,
- lvl,
- xp,
- nxtLvlXP-xp,
+ msg, lvl, xp, nxtLvlXP-xp,
)).Send()
if err != nil {
s.Logger().Error("sending rank", "error", err)