avoid issue with not having before_invoke called (#4129)

This commit is contained in:
Michael H 2020-08-05 21:34:55 -04:00 committed by GitHub
parent 39ae4a3b58
commit 29543ed118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -809,7 +809,9 @@ class Group(GroupMixin, Command, CogGroupMixin, DPYGroup):
if self.autohelp and not self.invoke_without_command:
if not await self.can_run(ctx, change_permission_state=True):
raise CheckFailure()
await ctx.send_help()
# This ordering prevents sending help before checking `before_invoke` hooks
await super().invoke(ctx)
return await ctx.send_help()
elif self.invoke_without_command:
# So invoke_without_command when a subcommand of this group is invoked
# will skip the the invokation of *this* command. However, because of