build(gokord): upgrade to 0.10.0

This commit is contained in:
Anhgelus Morhtuuzh 2025-06-04 15:11:16 +02:00
parent b92911fb6c
commit 48eb4410ad
Signed by: anhgelus
GPG key ID: CAD341EFA92DDDE5
7 changed files with 23 additions and 31 deletions

View file

@ -7,17 +7,16 @@ import (
"github.com/bwmarrin/discordgo"
)
func Reset(s *discordgo.Session, i *discordgo.InteractionCreate) {
func Reset(s *discordgo.Session, i *discordgo.InteractionCreate, optMap utils.OptionMap, resp *utils.ResponseBuilder) {
var copaings []*user.Copaing
gokord.DB.Where("guild_id = ?", i.GuildID).Delete(&copaings)
if err := utils.NewResponseBuilder(s, i).IsEphemeral().SetMessage("L'XP a été reset.").Send(); err != nil {
if err := resp.IsEphemeral().SetMessage("L'XP a été reset.").Send(); err != nil {
utils.SendAlert("commands/reset.go - Sending success (all)", err.Error())
}
}
func ResetUser(s *discordgo.Session, i *discordgo.InteractionCreate) {
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
optMap := utils.GenerateOptionMap(i)
func ResetUser(s *discordgo.Session, i *discordgo.InteractionCreate, optMap utils.OptionMap, resp *utils.ResponseBuilder) {
resp.IsEphemeral()
v, ok := optMap["user"]
if !ok {
if err := resp.SetMessage("Le user n'a pas été renseigné.").Send(); err != nil {