aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_core/_bot.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-07-25 11:59:37 +0100
committerGravatar Chris Lovering <[email protected]>2023-07-25 13:21:12 +0100
commit76eb582e304e52d7619c45d181f8cb0f00d2ac90 (patch)
tree4e06b33cae2feaab4858191218aaf368440e63b6 /pydis_core/_bot.py
parentMerge 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/_bot.py')
-rw-r--r--pydis_core/_bot.py6
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.