@@ -1026,7 +1026,7 @@ async def invoke(self, ctx: Context[BotT], /) -> None:
1026
1026
ctx .invoked_subcommand = None
1027
1027
ctx .subcommand_passed = None
1028
1028
injected = hooked_wrapped_callback (self , ctx , self .callback ) # type: ignore
1029
- await injected (* ctx .args , ** ctx .kwargs ) # type: ignore
1029
+ return await injected (* ctx .args , ** ctx .kwargs ) # type: ignore ###
1030
1030
1031
1031
async def reinvoke (self , ctx : Context [BotT ], / , * , call_hooks : bool = False ) -> None :
1032
1032
ctx .command = self
@@ -1641,18 +1641,20 @@ async def invoke(self, ctx: Context[BotT], /) -> None:
1641
1641
1642
1642
if early_invoke :
1643
1643
injected = hooked_wrapped_callback (self , ctx , self .callback ) # type: ignore
1644
- await injected (* ctx .args , ** ctx .kwargs ) # type: ignore
1644
+ result = await injected (* ctx .args , ** ctx .kwargs ) # type: ignore ###
1645
+ if result :
1646
+ return result
1645
1647
1646
1648
ctx .invoked_parents .append (ctx .invoked_with ) # type: ignore
1647
1649
1648
1650
if trigger and ctx .invoked_subcommand :
1649
1651
ctx .invoked_with = trigger
1650
- await ctx .invoked_subcommand .invoke (ctx )
1652
+ return await ctx .invoked_subcommand .invoke (ctx ) ###
1651
1653
elif not early_invoke :
1652
1654
# undo the trigger parsing
1653
1655
view .index = previous
1654
1656
view .previous = previous
1655
- await super ().invoke (ctx )
1657
+ return await super ().invoke (ctx ) ###
1656
1658
1657
1659
async def reinvoke (self , ctx : Context [BotT ], / , * , call_hooks : bool = False ) -> None :
1658
1660
ctx .invoked_subcommand = None
0 commit comments