Skip to content

[ENHANCEMENT] Use cogs for commands #46

Open
@flying-python

Description

@flying-python

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions