Are there downsides to always deferReply / deferUpdate?
My code is starting to get littered with
await interaction.deferReply() at the beginning of each slash command function.
I'm considering to make defer part of my command router, which would make defer global to every command, even if some of them respond very quickly.
Are there downsides to doing this, other than always editing the reply and showing the user "bot is thinking" etc?6 Replies
It is an extra request to the interaction. Also you can't show a modal after a defer.
what are the downsides of an extra request?
i guess if i
await the defer, the entire thing takes even longer, and i might run into usage limits / API throttling sooner (though for my use case this isn't an issue).I wouldn't really call it a downside. Each interaction has its own rate limit. But if you have an interaction which doesn't require a defer, then you shouldn't defer.
got it. thank you.
The thread owner has marked this issue as solved.