Skip to content

Commit 8bbbe14

Browse files
committed
Merge conditionals and remove redundant check
1 parent 12308bc commit 8bbbe14

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

twitchio/ext/commands/core.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,12 @@ async def _invoke(self, context: Context) -> None:
387387
context._invoked_with = f"{context._invoked_with} {trigger}"
388388
context._subcommand_trigger = trigger or None
389389

390-
if not trigger:
390+
if not trigger or not next_ and self._invoke_fallback:
391391
await super()._invoke(context=context)
392392

393-
elif trigger and next_:
393+
elif next_:
394394
await next_.invoke(context=context)
395395

396-
elif self._invoke_fallback:
397-
await super()._invoke(context=context)
398-
399396
else:
400397
raise CommandNotFound(f'The sub-command "{trigger}" for group "{self._name}" was not found.')
401398

0 commit comments

Comments
 (0)