fix(command): using wrong key for /rank due to previous automatic refactor
This commit is contained in:
parent
f2fbf1db92
commit
a02a0d8e3e
2 changed files with 4 additions and 10 deletions
|
@ -15,7 +15,7 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
m := i.Member
|
m := i.Member
|
||||||
var err error
|
var err error
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.ResponseBuilder{C: s, I: i}
|
||||||
if v, ok := optMap["user"]; ok {
|
if v, ok := optMap["copaing"]; ok {
|
||||||
u := v.UserValue(s)
|
u := v.UserValue(s)
|
||||||
if u.Bot {
|
if u.Bot {
|
||||||
err = resp.Message("Imagine si les bots avaient un niveau :rolling_eyes:").IsEphemeral().Send()
|
err = resp.Message("Imagine si les bots avaient un niveau :rolling_eyes:").IsEphemeral().Send()
|
||||||
|
|
12
main.go
12
main.go
|
@ -43,11 +43,11 @@ func main() {
|
||||||
|
|
||||||
adm := gokord.AdminPermission
|
adm := gokord.AdminPermission
|
||||||
|
|
||||||
rankCmd := gokord.NewCommand("rank", "Affiche le niveau d'un user").
|
rankCmd := gokord.NewCommand("rank", "Affiche le niveau d'un copaing").
|
||||||
HasOption().
|
HasOption().
|
||||||
AddOption(gokord.NewOption(
|
AddOption(gokord.NewOption(
|
||||||
discordgo.ApplicationCommandOptionUser,
|
discordgo.ApplicationCommandOptionUser,
|
||||||
"user",
|
"copaing",
|
||||||
"Le niveau du Copaing que vous souhaitez obtenir",
|
"Le niveau du Copaing que vous souhaitez obtenir",
|
||||||
)).
|
)).
|
||||||
SetHandler(commands.Rank)
|
SetHandler(commands.Rank)
|
||||||
|
@ -185,13 +185,7 @@ func afterInit(dg *discordgo.Session) {
|
||||||
dg.AddHandler(OnVoiceUpdate)
|
dg.AddHandler(OnVoiceUpdate)
|
||||||
dg.AddHandler(OnLeave)
|
dg.AddHandler(OnLeave)
|
||||||
|
|
||||||
// setup timer for periodic reducer
|
stopPeriodicReducer = utils.NewTimer(24*time.Hour, func(stop chan<- interface{}) {
|
||||||
d := 24 * time.Hour
|
|
||||||
if gokord.Debug {
|
|
||||||
// reduce time for debug
|
|
||||||
d = time.Minute
|
|
||||||
}
|
|
||||||
stopPeriodicReducer = utils.NewTimer(d, func(stop chan<- interface{}) {
|
|
||||||
user.PeriodicReducer(dg)
|
user.PeriodicReducer(dg)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue