Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer interactions correctly #55

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Defer interactions correctly #55

merged 2 commits into from
Aug 9, 2022

Conversation

reinacchi
Copy link
Owner

I had opened 3 pull requests regarding this and yet I had to revert them all. However, this should really fix the main issue of interactions aren't responding.

From what I've seen from the logs, it seems that this issue occurs depending on the circumstances. Interaction defer won't work when there's no network interruption between the client and the API however, interaction defer is needed when API fetch takes more than 3 seconds to finish.

In the end, I implemented a timeout of up to 4 seconds to defer and let it do the rest. Although this is recommended to do on all Discord bots yet, I never noticed.

@reinacchi
Copy link
Owner Author

Keeping this PR open until everything works as it should.

@reinacchi reinacchi mentioned this pull request Aug 8, 2022
Copy link
Owner Author

@reinacchi reinacchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed testing phrases, looks good enough.

@reinacchi reinacchi merged commit 7687e66 into main Aug 9, 2022
@reinacchi reinacchi deleted the defer branch August 9, 2022 09:19
reinacchi added a commit that referenced this pull request Apr 2, 2023
Defer interactions correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant