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

Check if we have the SERVER_MEMBERS intent before fetching server members #53

Merged
merged 3 commits into from
Sep 17, 2021

Conversation

kaine119
Copy link
Contributor

Summary

Fixes #51.

The gateway doesn't respond if we try to ask for server members without first declaring the intent. Originally, Server#members would just wait for a response that isn't coming, causing it to never return. This change checks the intents we sent with the gateway first before requesting members.


Added

  • Exposed Gateway#intents, the final calculated intents parameter sent to the gateway
  • Server#members now raises a RuntimeError if the gateway was not initialized with the SERVER_MEMBERS intent

@swarley swarley merged commit 27efa29 into shardlab:main Sep 17, 2021
@swarley
Copy link
Member

swarley commented Sep 17, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server#members hangs when bot doesn't use SERVER_MEMBERS intent
2 participants