aboutsummaryrefslogtreecommitdiff
path: root/commands/stats.go
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-08-31 14:57:29 +0200
committerWilliam Hergès <william@herges.fr>2025-08-31 14:57:29 +0200
commit49e4fc5971e44305d99952438cf087b0b42d6592 (patch)
tree0d5d8cc858e39a8ab11fadfe81b48479992fef1c /commands/stats.go
parent103bc0358fff171c949475406cec8161819a5a05 (diff)
perf(stats): send deferred before creating plot
Diffstat (limited to 'commands/stats.go')
-rw-r--r--commands/stats.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/stats.go b/commands/stats.go
index 1e55ddd..7a0da6b 100644
--- a/commands/stats.go
+++ b/commands/stats.go
@@ -48,8 +48,12 @@ func Stats(s *discordgo.Session, i *discordgo.InteractionCreate, opt cmd.OptionM
}
days = uint(in)
}
+ err := resp.IsDeferred().Send()
+ if err != nil {
+ logger.Alert("commands/stats.go - Sending deferred", err.Error())
+ return
+ }
var w io.WriterTo
- var err error
if v, ok := opt["user"]; ok {
w, err = statsMember(s, i, days, v.UserValue(s).ID)
} else {