aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-03-07 13:20:56 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2026-03-07 13:29:46 +0100
commit89b23632f5ceeebd82132210c1407dc9514a547b (patch)
tree647782dc5f1b1148893c10bc8b3e712b6ea8362b /commands
parent9da4d0379b10da8b33563dcd280aa2a9586aa3fb (diff)
feat(gokord): replace snowflake by uintrefactor/leave-old-gokord
Diffstat (limited to 'commands')
-rw-r--r--commands/config.go8
-rw-r--r--commands/deploy.go2
-rw-r--r--commands/stats.go2
-rw-r--r--commands/top.go2
4 files changed, 8 insertions, 6 deletions
diff --git a/commands/config.go b/commands/config.go
index 37aa953..f2dcf60 100644
--- a/commands/config.go
+++ b/commands/config.go
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"slices"
+ "strconv"
"strings"
"git.anhgelus.world/anhgelus/les-copaings-bot/config"
@@ -20,7 +21,7 @@ const (
OpenConfig = "config"
)
-func ConfigResponse(ctx context.Context, guildID string) *interaction.Response {
+func ConfigResponse(ctx context.Context, guildID uint64) *interaction.Response {
cfg := config.GetGuildConfig(ctx, guildID)
roles := ""
l := len(cfg.XpRoles) - 1
@@ -41,14 +42,15 @@ func ConfigResponse(ctx context.Context, guildID string) *interaction.Response {
var disChansDefault []component.SelectMenuDefaultValue
for _, c := range disChans {
if c != "" {
+ v, _ := strconv.ParseUint(c, 10, 64)
disChansDefault = append(disChansDefault, component.SelectMenuDefaultValue{
- ID: c,
+ ID: v,
Type: types.SelectMenuDefaultValueChannel,
})
}
}
var defaultChan []component.SelectMenuDefaultValue
- if len(cfg.FallbackChannel) > 0 {
+ if cfg.FallbackChannel != 0 {
defaultChan = append(defaultChan, component.SelectMenuDefaultValue{
ID: cfg.FallbackChannel,
Type: types.SelectMenuDefaultValueChannel,
diff --git a/commands/deploy.go b/commands/deploy.go
index 7b039f2..0890cf8 100644
--- a/commands/deploy.go
+++ b/commands/deploy.go
@@ -68,7 +68,7 @@ func init() {
}
func Deploy(ctx context.Context, dg bot.Session) error {
- guildID := ""
+ var guildID uint64
if common.IsDebug(ctx) {
guildID = dg.GuildState().ListGuilds()[0]
bot.Logger(ctx).Debug("using guild as debug", "guild", guildID)
diff --git a/commands/stats.go b/commands/stats.go
index 2cc0b3e..15f258b 100644
--- a/commands/stats.go
+++ b/commands/stats.go
@@ -118,7 +118,7 @@ func statsAll(ctx context.Context, dg bot.Session, i *interaction.ApplicationCom
})
}
-func statsMember(ctx context.Context, dg bot.Session, i *interaction.ApplicationCommand, days int, discordID string) (io.WriterTo, error) {
+func statsMember(ctx context.Context, dg bot.Session, i *interaction.ApplicationCommand, days int, discordID uint64) (io.WriterTo, error) {
_, err := guild.GetMember(i.GuildID, discordID).Do(ctx)
if err != nil {
return nil, err
diff --git a/commands/top.go b/commands/top.go
index aa0c288..82183a1 100644
--- a/commands/top.go
+++ b/commands/top.go
@@ -59,7 +59,7 @@ func Top(ctx context.Context, dg bot.Session, i *interaction.ApplicationCommand)
func genTopsMessage(tops []user.CopaingCached) string {
msg := ""
for i, c := range tops {
- msg += fmt.Sprintf("%d. **<@%s>** - niveau %d", i+1, c.DiscordID, exp.Level(c.XP))
+ msg += fmt.Sprintf("%d. **<@%d>** - niveau %d", i+1, c.DiscordID, exp.Level(c.XP))
if i != len(tops)-1 {
msg += "\n"
}