aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-04-16 15:23:15 +0200
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-04-16 15:23:15 +0200
commitef39c156f94b854796bb1c2adddfd40a5acaeca8 (patch)
treeac24922c2b02f4d17c66bfaabc16aee1f13fd7c9 /commands
parentc3dc81bd29318a4916bf8fc383a0d1a5ca90fa64 (diff)
feat(reducer): role update on new level
Diffstat (limited to 'commands')
-rw-r--r--commands/rank.go4
-rw-r--r--commands/top.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/commands/rank.go b/commands/rank.go
index d056de1..219977d 100644
--- a/commands/rank.go
+++ b/commands/rank.go
@@ -10,7 +10,7 @@ import (
func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
optMap := utils.GenerateOptionMap(i)
c := xp.GetCopaing(i.Member.User.ID, i.GuildID) // current copaing = member who used /rank
- xp.LastEventUpdate(c) // update xp and reset last event
+ xp.LastEventUpdate(s, c) // update xp and reset last event
msg := "Votre niveau"
m := i.Member
var err error
@@ -41,7 +41,7 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
}
c.DiscordID = u.ID // current copaing = member targeted by member who wrote /rank
c.Load() // reload copaing (change line before)
- xp.XPUpdate(c) // update xp without resetting event
+ xp.XPUpdate(s, c) // update xp without resetting event
msg = fmt.Sprintf("Le niveau de %s", m.DisplayName())
}
lvl := xp.Level(c.XP)
diff --git a/commands/top.go b/commands/top.go
index 6df259f..c0f4dae 100644
--- a/commands/top.go
+++ b/commands/top.go
@@ -9,7 +9,7 @@ import (
)
func Top(s *discordgo.Session, i *discordgo.InteractionCreate) {
- xp.LastEventUpdate(xp.GetCopaing(i.User.ID, i.GuildID))
+ xp.LastEventUpdate(s, xp.GetCopaing(i.User.ID, i.GuildID))
resp := utils.ResponseBuilder{C: s, I: i}
err := resp.IsDeferred().Send()
if err != nil {