fix(config): not deleting role
This commit is contained in:
parent
9e6a5ce1d3
commit
bde93e6b80
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@ package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/anhgelus/gokord"
|
||||||
"github.com/anhgelus/gokord/utils"
|
"github.com/anhgelus/gokord/utils"
|
||||||
"github.com/anhgelus/les-copaings-bot/config"
|
"github.com/anhgelus/les-copaings-bot/config"
|
||||||
"github.com/anhgelus/les-copaings-bot/xp"
|
"github.com/anhgelus/les-copaings-bot/xp"
|
||||||
|
@ -90,7 +91,7 @@ func ConfigXP(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
RoleID: role.ID,
|
RoleID: role.ID,
|
||||||
})
|
})
|
||||||
case "del":
|
case "del":
|
||||||
pos, r := cfg.FindXpRole(exp, role.ID)
|
_, r := cfg.FindXpRole(exp, role.ID)
|
||||||
if r == nil {
|
if r == nil {
|
||||||
err := resp.Message("Le rôle n'a pas été trouvé dans la config.").Send()
|
err := resp.Message("Le rôle n'a pas été trouvé dans la config.").Send()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -98,7 +99,7 @@ func ConfigXP(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cfg.XpRoles = append(cfg.XpRoles[:pos], cfg.XpRoles[pos+1:]...)
|
gokord.DB.Delete(r)
|
||||||
case "edit":
|
case "edit":
|
||||||
pos, r := cfg.FindXpRole(exp, role.ID)
|
pos, r := cfg.FindXpRole(exp, role.ID)
|
||||||
if r == nil {
|
if r == nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue