Skip to content

Commit

Permalink
Merge conditionals and remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
chillymosh committed Oct 7, 2024
1 parent 12308bc commit 8bbbe14
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions twitchio/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,12 @@ async def _invoke(self, context: Context) -> None:
context._invoked_with = f"{context._invoked_with} {trigger}"
context._subcommand_trigger = trigger or None

if not trigger:
if not trigger or not next_ and self._invoke_fallback:
await super()._invoke(context=context)

elif trigger and next_:
elif next_:
await next_.invoke(context=context)

elif self._invoke_fallback:
await super()._invoke(context=context)

else:
raise CommandNotFound(f'The sub-command "{trigger}" for group "{self._name}" was not found.')

Expand Down

0 comments on commit 8bbbe14

Please sign in to comment.