Skip to content

Commands in the SlashCommandGroup treat optional arguments as required #1385

@yoggys

Description

@yoggys

Summary

Commands in the SlashCommandGroup treat optional arguments as required

Reproduction Steps

  • Create SlashCommandGroup and add command with optional parameter to it eg:
    member: discord.Member = None or member: discord.Option(discord.Member) = None
  • Go to any server where you can use this command
  • Start writing a command and look at the parameters

Minimal Reproducible Code

test = SlashCommandGroup("test", "testing...")

@test.command(name='testcommand')
async def testcommand(
    self, 
    ctx: discord.ApplicationContext, 
    member: discord.Member = None, # or discord.Option(discord.Member) = None
):
    pass

Expected Results

Parameter should be marked as optional:
image

Actual Results

Parameter is marked as required:
image

Intents

discord.Intents.all()

System Information

- Python v3.8.13-final
- py-cord v2.0.0-candidate
    - py-cord pkg_resources: v2.0.0rc1
- aiohttp v3.8.1
- system info: Linux 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

Previously no problem, after update to the latest version there are problems with it

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority: highHigh Priority

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions