Cog slash commands default option doesn't work as intended
Summary
flag isn't working as intended in cogs
Reproduction Steps
Ran the code snippet below in a cog and ran the /sprite command without adding form option (since it's optional)
Minimal Reproducible Code
@slash_command(name='sprite', description="Displays the Pokemon's Home sprite")
@option('shiny', str, description='You want shiny sprite or normal?', choices=["Normal","Shiny"], required=True)
@option('name', str, description="Name of Pokemon", required=True)
@option('form', str, description="Any regional/unique form?", required=False, default="None")
async def _sprite_slash(self, ctx: ApplicationContext, shiny: str, name: str, form: str):
print(shiny)
print(form)
print(name)
await ctx.respond("The input is recieved")
Expected Results
Expected default to fill in form with the default value if nothing was entered
Actual Results
Ignoring exception in command <discord.app.commands.SlashCommand name=sprite>: Traceback (most recent call last): File "C:....\anaconda3\envs\pycordalpha\lib\site-packages\discord\app\commands.py", line 93, in wrapped ret = await coro(*args, **kwargs) TypeError: _sprite_slash() missing 1 required positional argument: 'form'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:....\anaconda3\envs\pycordalpha\lib\site-packages\discord\bot.py", line 227, in process_application_commands await ctx.command.invoke(ctx) File "C:....\anaconda3\envs\pycordalpha\lib\site-packages\discord\app\commands.py", line 199, in invoke await injected(*self.args, **self.kwargs) File "C:....\anaconda3\envs\pycordalpha\lib\site-packages\discord\app\commands.py", line 99, in wrapped raise ApplicationCommandInvokeError(exc) from exc discord.app.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: _sprite_slash() missing 1 required positional argument: 'form'
Intents
defaults
System Information
- Python v3.8.11-final
- pycord v2.0.0-alpha
- pycord pkg_resources: v2.0.0a3974+g35a1364c
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.19043
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
No response
Not sure if anything changed between now and 7 days ago but there is no error (using the slash branch) now
Yep just tested it now and it works as intended.