aboutsummaryrefslogtreecommitdiff
path: root/commands/config.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-01-22 21:53:29 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2026-01-22 21:53:29 +0100
commit3e65b4f6281ddc4039a27a62428db8a95ffc3677 (patch)
treeb1005f908be45aa47da48b604f3863ef23a3d7ea /commands/config.go
parent8255a2e51454049f3ac1532f6e1125f528691c37 (diff)
refactor(): completely remove old gokord and finish to update everything to use contexts
Diffstat (limited to 'commands/config.go')
-rw-r--r--commands/config.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/commands/config.go b/commands/config.go
index 12d1c4d..d9b04ec 100644
--- a/commands/config.go
+++ b/commands/config.go
@@ -20,8 +20,8 @@ const (
OpenConfig = "config"
)
-func ConfigResponse(guildID string) *interaction.Response {
- cfg := config.GetGuildConfig(guildID)
+func ConfigResponse(ctx context.Context, guildID string) *interaction.Response {
+ cfg := config.GetGuildConfig(ctx, guildID)
roles := ""
l := len(cfg.XpRoles) - 1
slices.SortFunc(cfg.XpRoles, func(xp1, xp2 config.XpRole) int {
@@ -121,14 +121,14 @@ func ConfigResponse(guildID string) *interaction.Response {
}
func ConfigCommand(ctx context.Context, dg bot.Session, i *interaction.ApplicationCommand) {
- err := dg.InteractionAPI().Respond(i.Interaction, ConfigResponse(i.GuildID)).Do(ctx)
+ err := dg.InteractionAPI().Respond(i.Interaction, ConfigResponse(ctx, i.GuildID)).Do(ctx)
if err != nil {
bot.Logger(ctx).Error("sending config", "error", err)
}
}
func ConfigMessageComponent(ctx context.Context, dg bot.Session, i *interaction.MessageComponent) {
- response := ConfigResponse(i.GuildID)
+ response := ConfigResponse(ctx, i.GuildID)
response.Type = types.InteractionResponseUpdateMessage
err := dg.InteractionAPI().Respond(i.Interaction, response).Do(ctx)
@@ -138,7 +138,7 @@ func ConfigMessageComponent(ctx context.Context, dg bot.Session, i *interaction.
}
func ConfigModal(ctx context.Context, dg bot.Session, i *interaction.ModalSubmit) {
- response := ConfigResponse(i.GuildID)
+ response := ConfigResponse(ctx, i.GuildID)
response.Type = types.InteractionResponseUpdateMessage
err := dg.InteractionAPI().Respond(i.Interaction, response).Do(ctx)