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

[ENHANCEMENT] Use cogs for commands #46

Open
flying-python opened this issue May 29, 2021 · 1 comment
Open

[ENHANCEMENT] Use cogs for commands #46

flying-python opened this issue May 29, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request hacktoberfest

Comments

@flying-python
Copy link

async def on_ready():

Many commands and events in this project does not use cogs. Usage of cogs is recommended. And also don't load commands in on_ready event when you are not using cogs.

The on_ready event may be called multiple times during the execution of the bot. When called multiple times, errors are raised if you load commands in on_ready event.

The Discord API says,

This function is not guaranteed to be the first event called. Likewise, this function is not guaranteed to only be called once. This library implements reconnection logic and thus will end up calling this event whenever a RESUME request fails.

Note: You may need to rewrite large portions of this bot to fix this issue. Make sure to test everything works in your cogs before adding them to github.

Sources:

  1. Official discord.py docs: https://discordpy.readthedocs.io/en/latest/api.html#discord.on_ready
@ColaIan ColaIan added the enhancement New feature or request label May 29, 2021
@RedTeaDev RedTeaDev assigned ColaIan, RedTeaDev and ghost May 29, 2021
@ColaIan ColaIan removed their assignment May 29, 2021
@Dremixbotdev
Copy link
Contributor

I will open a pull request for this

@ColaIan ColaIan changed the title Don't add commands in on_ready event [ENHANCEMENT] Use cogs for commands Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

4 participants