Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ async def can_run(self, ctx: ApplicationContext) -> bool:
raise CheckFailure(f"The global check functions for command {self.name} failed.")

predicates = self.checks
if self.parent is not None:
# parent checks should be ran first
predicates = self.parent.checks + predicates

if not predicates:
# since we have no checks, then we just return True.
return True
Expand Down Expand Up @@ -898,7 +902,7 @@ def __init__(
self.subcommands: List[Union[SlashCommand, SlashCommandGroup]] = self.__initial_commands__
self.guild_ids = guild_ids
self.parent = parent
self.checks = []
self.checks = kwargs.get("checks", [])

self._before_invoke = None
self._after_invoke = None
Expand Down