diff --git a/docs/changelog.rst b/docs/changelog.rst index a84427b5..8d57aa01 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,5 +1,11 @@ :orphan: +2.8.1 +====== +- ext.commands + - Bug fixes + - Fixed an issue where ``CommandNotFound`` couldn't be processed from ``get_context``. + 2.8.0 ====== - TwitchIO diff --git a/twitchio/__init__.py b/twitchio/__init__.py index d4e2ca50..d93bb65f 100644 --- a/twitchio/__init__.py +++ b/twitchio/__init__.py @@ -28,7 +28,7 @@ __author__ = "TwitchIO, PythonistaGuild" __license__ = "MIT" __copyright__ = "Copyright 2017-2022 (c) TwitchIO" -__version__ = "2.8.0" +__version__ = "2.8.1" from .client import Client from .user import * diff --git a/twitchio/ext/commands/bot.py b/twitchio/ext/commands/bot.py index 11840b5d..9eda058c 100644 --- a/twitchio/ext/commands/bot.py +++ b/twitchio/ext/commands/bot.py @@ -302,7 +302,7 @@ async def get_context(self, message, *, cls=None): command_ = parsed.pop(0) except KeyError: context = cls(message=message, bot=self, prefix=prefix, command=None, valid=False, view=view) - error = CommandNotFound("No valid command was passed.") + error = CommandNotFound("No valid command was passed.", "") self.run_event("command_error", context, error) return context @@ -314,7 +314,7 @@ async def get_context(self, message, *, cls=None): command_ = self.commands[command_] else: context = cls(message=message, bot=self, prefix=prefix, command=None, valid=False, view=view) - error = CommandNotFound(f'No command "{command_}" was found.') + error = CommandNotFound(f'No command "{command_}" was found.', command_) self.run_event("command_error", context, error) return context