Skip to content

Commit 29543ed

Browse files
avoid issue with not having before_invoke called (Cog-Creators#4129)
1 parent 39ae4a3 commit 29543ed

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

redbot/core/commands/commands.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,9 @@ async def invoke(self, ctx: "Context"):
809809
if self.autohelp and not self.invoke_without_command:
810810
if not await self.can_run(ctx, change_permission_state=True):
811811
raise CheckFailure()
812-
await ctx.send_help()
812+
# This ordering prevents sending help before checking `before_invoke` hooks
813+
await super().invoke(ctx)
814+
return await ctx.send_help()
813815
elif self.invoke_without_command:
814816
# So invoke_without_command when a subcommand of this group is invoked
815817
# will skip the the invokation of *this* command. However, because of

0 commit comments

Comments
 (0)