From c661541e45dddd6a082af66fcf7df7ba7dfdc6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Sat, 17 Jan 2026 21:50:54 +0100 Subject: perf(command): store data used by top in state --- commands/rank.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'commands/rank.go') 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) -- cgit v1.2.3