aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-05-13 18:24:27 +0200
committerAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-05-13 18:24:27 +0200
commita02a0d8e3e45d738c5a1a07dbc925c329ddf6278 (patch)
treeaefb2103b185d6ab52cb8bb2e9a28b3a083867b3
parentf2fbf1db929e4bd2b3af014fb8d9af4c0f934a1e (diff)
fix(command): using wrong key for /rank due to previous automatic refactor
-rw-r--r--commands/rank.go2
-rw-r--r--main.go12
2 files changed, 4 insertions, 10 deletions
diff --git a/commands/rank.go b/commands/rank.go
index d079a84..70c0222 100644
--- a/commands/rank.go
+++ b/commands/rank.go
@@ -15,7 +15,7 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
m := i.Member
var err error
resp := utils.ResponseBuilder{C: s, I: i}
- if v, ok := optMap["user"]; ok {
+ if v, ok := optMap["copaing"]; ok {
u := v.UserValue(s)
if u.Bot {
err = resp.Message("Imagine si les bots avaient un niveau :rolling_eyes:").IsEphemeral().Send()
diff --git a/main.go b/main.go
index a1fc1af..6b714f1 100644
--- a/main.go
+++ b/main.go
@@ -43,11 +43,11 @@ func main() {
adm := gokord.AdminPermission
- rankCmd := gokord.NewCommand("rank", "Affiche le niveau d'un user").
+ rankCmd := gokord.NewCommand("rank", "Affiche le niveau d'un copaing").
HasOption().
AddOption(gokord.NewOption(
discordgo.ApplicationCommandOptionUser,
- "user",
+ "copaing",
"Le niveau du Copaing que vous souhaitez obtenir",
)).
SetHandler(commands.Rank)
@@ -185,13 +185,7 @@ func afterInit(dg *discordgo.Session) {
dg.AddHandler(OnVoiceUpdate)
dg.AddHandler(OnLeave)
- // setup timer for periodic reducer
- d := 24 * time.Hour
- if gokord.Debug {
- // reduce time for debug
- d = time.Minute
- }
- stopPeriodicReducer = utils.NewTimer(d, func(stop chan<- interface{}) {
+ stopPeriodicReducer = utils.NewTimer(24*time.Hour, func(stop chan<- interface{}) {
user.PeriodicReducer(dg)
})
}