From 3e65b4f6281ddc4039a27a62428db8a95ffc3677 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 22 Jan 2026 21:53:29 +0100 Subject: refactor(): completely remove old gokord and finish to update everything to use contexts --- commands/config.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'commands/config.go') 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) -- cgit v1.2.3