diff options
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/deploy.go | 6 | ||||
| -rw-r--r-- | commands/stats.go | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/commands/deploy.go b/commands/deploy.go index c388228..ee98d07 100644 --- a/commands/deploy.go +++ b/commands/deploy.go @@ -71,11 +71,7 @@ func Deploy(ctx context.Context, dg bot.Session) error { guildID := "" if common.IsDebug(ctx) { guildID = dg.GuildAPI().State.Guilds()[0] - gld, err := dg.GuildAPI().State.Guild(guildID) - if err != nil { - return err - } - bot.Logger(ctx).Debug("using guild as debug", "guild", gld.Name) + bot.Logger(ctx).Debug("using guild as debug", "guild", guildID) } _, err := dg.InteractionAPI().CommandBulkOverwrite(dg.SessionState().Application().ID, guildID, commands).Do(ctx) return err diff --git a/commands/stats.go b/commands/stats.go index 017cfc6..fbacb88 100644 --- a/commands/stats.go +++ b/commands/stats.go @@ -53,9 +53,14 @@ func Stats(ctx context.Context, dg bot.Session, i *interaction.ApplicationComman days = 90 } + err := dg.InteractionAPI().Respond(i.Interaction, interaction.NewDeferredResponse()).Do(ctx) + if err != nil { + bot.Logger(ctx).Error("sending deferred", "error", err) + } + resp := interaction.NewMessageResponse() defer func() { - err := dg.InteractionAPI().Respond(i.Interaction, resp.Response()).Do(ctx) + _, err := dg.InteractionAPI().ResponseEdit(i.Interaction, resp.WebhookEdit()).Do(ctx) if err != nil { bot.Logger(ctx).Error("replying to interaction", "error", err) } @@ -71,10 +76,6 @@ func Stats(ctx context.Context, dg bot.Session, i *interaction.ApplicationComman } days = int(in) } - err := dg.InteractionAPI().Respond(i.Interaction, interaction.NewDeferredResponse()).Do(ctx) - if err != nil { - bot.Logger(ctx).Error("sending deferred", "error", err) - } var w io.WriterTo if v, ok := opts["copaing"]; ok { w, err = statsMember(ctx, dg, i, days, v.UserValue(ctx).ID) |
