diff options
author | 2023-07-25 11:59:37 +0100 | |
---|---|---|
committer | 2023-07-25 13:21:12 +0100 | |
commit | 76eb582e304e52d7619c45d181f8cb0f00d2ac90 (patch) | |
tree | 4e06b33cae2feaab4858191218aaf368440e63b6 /pydis_core | |
parent | Merge pull request #188 from python-discord/paste-servic-emultiple-files (diff) |
Add BotBase.wait_until_bot_started which can be used to hold a process until all extensions are loaded.
Diffstat (limited to 'pydis_core')
-rw-r--r-- | pydis_core/_bot.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pydis_core/_bot.py b/pydis_core/_bot.py index 10cab457..a94dff56 100644 --- a/pydis_core/_bot.py +++ b/pydis_core/_bot.py @@ -231,6 +231,12 @@ class BotBase(commands.Bot): """ await self._guild_available.wait() + async def process_commands(self, message: discord.Message) -> None: + """Wait until all extensions are loaded before processing commands.""" + if self._extension_loading_task: + await self._extension_loading_task + await super().process_commands(message) + async def setup_hook(self) -> None: """ An async init to startup generic services. |