diff --git a/disnake/ext/commands/cog.py b/disnake/ext/commands/cog.py index 01fd59937c..bc1cff6e9a 100644 --- a/disnake/ext/commands/cog.py +++ b/disnake/ext/commands/cog.py @@ -34,6 +34,7 @@ from disnake.interactions import ApplicationCommandInteraction + from ._types import MaybeCoro from .bot import AutoShardedBot, AutoShardedInteractionBot, Bot, InteractionBot from .context import Context from .core import Command @@ -491,7 +492,7 @@ def cog_unload(self) -> None: pass @_cog_special_method - def bot_check_once(self, ctx: Context) -> bool: + def bot_check_once(self, ctx: Context) -> MaybeCoro[bool]: """A special method that registers as a :meth:`.Bot.check_once` check. @@ -503,7 +504,7 @@ def bot_check_once(self, ctx: Context) -> bool: return True @_cog_special_method - def bot_check(self, ctx: Context) -> bool: + def bot_check(self, ctx: Context) -> MaybeCoro[bool]: """A special method that registers as a :meth:`.Bot.check` check. @@ -515,7 +516,7 @@ def bot_check(self, ctx: Context) -> bool: return True @_cog_special_method - def bot_slash_command_check_once(self, inter: ApplicationCommandInteraction) -> bool: + def bot_slash_command_check_once(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """A special method that registers as a :meth:`.Bot.slash_command_check_once` check. @@ -525,7 +526,7 @@ def bot_slash_command_check_once(self, inter: ApplicationCommandInteraction) -> return True @_cog_special_method - def bot_slash_command_check(self, inter: ApplicationCommandInteraction) -> bool: + def bot_slash_command_check(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """A special method that registers as a :meth:`.Bot.slash_command_check` check. @@ -535,27 +536,29 @@ def bot_slash_command_check(self, inter: ApplicationCommandInteraction) -> bool: return True @_cog_special_method - def bot_user_command_check_once(self, inter: ApplicationCommandInteraction) -> bool: + def bot_user_command_check_once(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """Similar to :meth:`.Bot.slash_command_check_once` but for user commands.""" return True @_cog_special_method - def bot_user_command_check(self, inter: ApplicationCommandInteraction) -> bool: + def bot_user_command_check(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """Similar to :meth:`.Bot.slash_command_check` but for user commands.""" return True @_cog_special_method - def bot_message_command_check_once(self, inter: ApplicationCommandInteraction) -> bool: + def bot_message_command_check_once( + self, inter: ApplicationCommandInteraction + ) -> MaybeCoro[bool]: """Similar to :meth:`.Bot.slash_command_check_once` but for message commands.""" return True @_cog_special_method - def bot_message_command_check(self, inter: ApplicationCommandInteraction) -> bool: + def bot_message_command_check(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """Similar to :meth:`.Bot.slash_command_check` but for message commands.""" return True @_cog_special_method - def cog_check(self, ctx: Context) -> bool: + def cog_check(self, ctx: Context) -> MaybeCoro[bool]: """A special method that registers as a :func:`~.check` for every text command and subcommand in this cog. @@ -567,7 +570,7 @@ def cog_check(self, ctx: Context) -> bool: return True @_cog_special_method - def cog_slash_command_check(self, inter: ApplicationCommandInteraction) -> bool: + def cog_slash_command_check(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """A special method that registers as a :func:`~.check` for every slash command and subcommand in this cog. @@ -577,12 +580,12 @@ def cog_slash_command_check(self, inter: ApplicationCommandInteraction) -> bool: return True @_cog_special_method - def cog_user_command_check(self, inter: ApplicationCommandInteraction) -> bool: + def cog_user_command_check(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """Similar to :meth:`.Cog.cog_slash_command_check` but for user commands.""" return True @_cog_special_method - def cog_message_command_check(self, inter: ApplicationCommandInteraction) -> bool: + def cog_message_command_check(self, inter: ApplicationCommandInteraction) -> MaybeCoro[bool]: """Similar to :meth:`.Cog.cog_slash_command_check` but for message commands.""" return True