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

Blocking code #3

Open
laggycomputer opened this issue Apr 10, 2019 · 0 comments
Open

Blocking code #3

laggycomputer opened this issue Apr 10, 2019 · 0 comments

Comments

@laggycomputer
Copy link

I'd like to point out that requests is non-asynchronous code.

Though it's a very good library, it is simply unusable with discord.py. Any requests will block up the event loop/thread and can cause Discord to disconnect the bot in some cases.

I'd strongly recommend using aiohttp instead, and setting a ClientSession to an attribute of your bot object to handle web requests properly.

I'd be glad to PR this.

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

No branches or pull requests

1 participant