fix(command): /rank prochain niveau not working
This commit is contained in:
parent
9f9c27f422
commit
e78c8d8c42
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
optMap := utils.GenerateOptionMap(i)
|
||||
c := xp.GetCopaing(i.User.ID, i.GuildID) // current copaing = member who used /rank
|
||||
c := xp.GetCopaing(i.Member.User.ID, i.GuildID) // current copaing = member who used /rank
|
||||
xp.LastEventUpdate(c) // update xp and reset last event
|
||||
msg := "Votre niveau"
|
||||
m := i.Member
|
||||
|
@ -45,13 +45,13 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
|||
msg = fmt.Sprintf("Le niveau de %s", m.DisplayName())
|
||||
}
|
||||
lvl := xp.Level(c.XP)
|
||||
nxtLvl := xp.XPForLevel(lvl + 1)
|
||||
nxtLvlXP := xp.XPForLevel(lvl + 1)
|
||||
err = resp.Message(fmt.Sprintf(
|
||||
"%s : **%d**\n> XP : %d\n> Prochain niveau dans %d XP",
|
||||
msg,
|
||||
lvl,
|
||||
c.XP,
|
||||
nxtLvl-lvl,
|
||||
nxtLvlXP-xp.XPForLevel(lvl),
|
||||
)).Send()
|
||||
if err != nil {
|
||||
utils.SendAlert("rank.go - Sending rank", err.Error())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue