Skip to content

Commit d5cba04

Browse files
committed
Fixed TypeError on command invoke can cause command re-invoke
1 parent 86933a3 commit d5cba04

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

discord_slash/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,15 +732,16 @@ async def invoke_command(self, func, ctx, args):
732732
ctx.kwargs = args
733733
ctx.args = list(args.values())
734734
try:
735-
await func.invoke(ctx, **args)
735+
coro = func.invoke(ctx, **args)
736736
except TypeError:
737737
args = list(args.values())
738738
not_kwargs = True
739739
else:
740740
ctx.args = args
741741
not_kwargs = True
742742
if not_kwargs:
743-
await func.invoke(ctx, *args)
743+
coro = func.invoke(ctx, *args)
744+
await coro
744745
except Exception as ex:
745746
await self.on_slash_command_error(ctx, ex)
746747

0 commit comments

Comments
 (0)