You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid waiting for message when bot will not see it
Previously, the code below the if-statement will always execute if eat
is False. In guilds where the bot only has the applications.commands scope, or guilds
with the bot scope where the bot cannot read the channel's messages, the bot will
not find SlashContext.message and will time out after 3 seconds. This unnecessary
wait slows down command execution.
With this change, the bot will only check for messages if one of the
following conditions are true:
- SlashContext.guild_id is None (i.e. command executed in a private DM)
or
- SlashContext.channel is not None (i.e. command executed in a guild with the bot scope),
and the bot has permission to view messages in the command's channel.
0 commit comments