Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands in the SlashCommandGroup treat optional arguments as required #1385

Closed
3 tasks done
yoggys opened this issue May 25, 2022 · 0 comments · Fixed by #1386
Closed
3 tasks done

Commands in the SlashCommandGroup treat optional arguments as required #1385

yoggys opened this issue May 25, 2022 · 0 comments · Fixed by #1386
Assignees
Labels
bug Something isn't working priority: high High Priority

Comments

@yoggys
Copy link
Contributor

yoggys commented May 25, 2022

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

@yoggys yoggys added the unconfirmed bug A bug report that needs triaging label May 25, 2022
@Lulalaby Lulalaby added bug Something isn't working priority: high High Priority and removed unconfirmed bug A bug report that needs triaging labels May 25, 2022
@Lulalaby Lulalaby linked a pull request May 25, 2022 that will close this issue
7 tasks
Lulalaby pushed a commit that referenced this issue May 26, 2022
Lulalaby pushed a commit that referenced this issue Jun 11, 2022
Dorukyum pushed a commit that referenced this issue Jul 26, 2022
…length` (#1527)

* Fix #1385

* key type fix (int => str)

* remove space

* fix issue discord.commands.Option while str and min/max_length were set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high High Priority
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants