You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An event similar to on_ready, that would be called once the bot has almost finished initializing, and everything is cached, but just before it starts receiving on_message events and sending commands
What is the feature request for?
The core library
The Problem
Some bots need to interact with the API when initializing, and this would provide an easy and safe way to make sure everything is ready before users can run any command, which could cause problems if some elements are missing.
The Ideal Solution
a simple blocking method that can would work similarly to on_ready, where the bot or client object would be available.
Example :
This is a minimalist example, but some bots need to cache elements before starting.
once the command returns, the bot will start listening for commands and messages
The Current Solution
currently, it is possible to add some checks at the start of every commands, that makes them return if it isn't initialized. However, this requires a check on every commands which can quickly be hard
Additional Context
No response
The text was updated successfully, but these errors were encountered:
leElvyn
changed the title
a "before_ready" event / signal if the bot needs to interact with the discord api
a "before_ready" event / signal if the bot needs to interact with the discord api on startup
Sep 2, 2021
The bot should always need to interact with the discord api on startup because, it needs to connect to the websocket! Also, If you have anything in the on_ready event that requires interaction with the discord API!
Summary
An event similar to on_ready, that would be called once the bot has almost finished initializing, and everything is cached, but just before it starts receiving on_message events and sending commands
What is the feature request for?
The core library
The Problem
Some bots need to interact with the API when initializing, and this would provide an easy and safe way to make sure everything is ready before users can run any command, which could cause problems if some elements are missing.
The Ideal Solution
a simple blocking method that can would work similarly to
on_ready
, where the bot or client object would be available.Example :
This is a minimalist example, but some bots need to cache elements before starting.
once the command returns, the bot will start listening for commands and messages
The Current Solution
currently, it is possible to add some checks at the start of every commands, that makes them return if it isn't initialized. However, this requires a check on every commands which can quickly be hard
Additional Context
No response
The text was updated successfully, but these errors were encountered: