aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--docs/changelog.rst4
-rw-r--r--pydis_core/_bot.py6
-rw-r--r--pyproject.toml2
3 files changed, 11 insertions, 1 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index adad0bc3..2dffd4c0 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -5,6 +5,10 @@ Changelog
=========
+- :release:`10.1.0 <25th July 2023>`
+- :feature:`190` Overwrite :obj:`discord.ext.commands.Bot.process_commands` to ensure no commands are processed until all extensions are loaded. This only works for clients using :obj:`pydis_core.BotBase.load_extensions`
+
+
- :release:`10.0.0 <14th July 2023>`
- :breaking:`188` Support sending multiple files at once to paste service. All calls to :obj:`pydis_core.utils.paste_service.send_to_paste_service` must now provide a list of :obj:`pydis_core.utils.paste_service.PasteFile`
- :bug:`187 major` Fix :obj:`pydis_core.utils.channel.get_or_fetch_channel`'s return type to include :obj:`discord.abc.PrivateChannel` and :obj:`discord.Thread`.
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.
diff --git a/pyproject.toml b/pyproject.toml
index 1f8514e8..d3d55dbb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pydis_core"
-version = "10.0.0"
+version = "10.1.0"
description = "PyDis core provides core functionality and utility to the bots of the Python Discord community."
authors = ["Python Discord <[email protected]>"]
license = "MIT"