Skip to content

Commit 5e0eb5b

Browse files
authored
changing sub commands example code (#761)
part of sub commands make trouble in python 3.10 above the error occur TypeError: run.<locals>.cmd() missing 1 required positional argument: 'second_option'
1 parent 23b0611 commit 5e0eb5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Nested commands: subcommands
208208
),
209209
],
210210
)
211-
async def cmd(ctx: interactions.CommandContext, sub_command: str, second_option: str, option: int = None):
211+
async def cmd(ctx: interactions.CommandContext, sub_command: str, second_option: str = "", option: int = None):
212212
if sub_command == "command_name":
213213
await ctx.send(f"You selected the command_name sub command and put in {option}")
214214
elif sub_command == "second_command":

0 commit comments

Comments
 (0)