From d0625154edeed584853c2a2c3871b612c127d4c4 Mon Sep 17 00:00:00 2001 From: Julien Mauroy Date: Mon, 10 Oct 2022 22:37:48 +0200 Subject: [PATCH] [commands] Add Cog.has_app_command_error_handler --- discord/ext/commands/cog.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 47276178f..31c540619 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -519,6 +519,13 @@ class Cog(metaclass=CogMeta): """ return not hasattr(self.cog_command_error.__func__, '__cog_special_method__') + def has_app_command_error_handler(self) -> bool: + """:class:`bool`: Checks whether the cog has an app error handler. + + .. versionadded:: 2.1 + """ + return not hasattr(self.cog_app_command_error.__func__, '__cog_special_method__') + @_cog_special_method async def cog_load(self) -> None: """|maybecoro|