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

Bot/Client does not run inside a given asyncio loop #420

Closed
Budovi opened this issue Dec 20, 2016 · 1 comment

Comments

@Budovi
Copy link

commented Dec 20, 2016

When creating a discord.Client or discord.ext.commands.Bot, you have an option to pass an event loop for the Client to use.

loop (Optional[event loop].) – The event loop to use for asynchronous operations. Defaults to None, in which case the default event loop is used via asyncio.get_event_loop().

A lot of calls in the library do not respect this choice, and a default event loop is used instead. You can find a lot of examples just by searching for asyncio.sleep( in the library code, where the loop needs to be passed as an argument.

This option does not make sense if broken, and thus

  • it should be either removed, or
  • it should be fixed so that the library only uses the loop provided, or
  • it should be clarified what operations is the given loop used for.

@Rapptz Rapptz added the bug label Dec 21, 2016

@Rapptz

This comment has been minimized.

Copy link
Owner

commented Dec 21, 2016

Where "a lot" was 5 7. Good catch nonetheless.

For the next bug report I recommend not using hyperboles.

@Rapptz Rapptz closed this in a2651a5 Dec 21, 2016

Rapptz added a commit that referenced this issue Dec 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.