Skip to content

Bot resilience #42

Description

@TwoLettuce

Overview

As the bot gets more complicated and execution time increases, it is likely that we will begin to run into problem's with discord's hard 3-second limit on interaction responses before it will communicate that the interaction failed. This can lead to interesting bugs but will be especially alarming to students/TAs because it will indicate that something went wrong when it actually didn't.

Proposed solution

Anywhere in the code where we use interaction.response.send_message() should be replaced with interaction.followup.send(), and the very first thing in the logical flow of that button, modal submission, slash command, etc. should be interaction.response.defer(). you can have the bot appear as though it is thinking by using thinking=True as an argument. If you plan to make the response message ephemeral, you can indicate that too.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions