diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-01-25 17:06:40 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-01-25 17:06:40 +0100 |
| commit | aff3447a7b84c85be0020af95aecaa6c14f8b09b (patch) | |
| tree | 007dfa9bcc9e528fa855358ff96a59eea0353feb /commands/stats.go | |
| parent | 2bf38473893b4fcd86ce7c97c04846237bb8cce4 (diff) | |
fix(commands): various dumb things
Diffstat (limited to 'commands/stats.go')
| -rw-r--r-- | commands/stats.go | 11 |
1 files changed, 6 insertions, 5 deletions
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) |
