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

docs: Document @option.parameter_name #2054

Merged
merged 1 commit into from
May 7, 2023

Conversation

NeloBlivion
Copy link
Member

Summary

@discord.option.parameter_name is a kwarg that allows you to have separate parameter and UI names for an option.
E.g.

@slash_command()
async def say(ctx, file: Option(Attachment, name="image"))

would look like

@slash_command()
@option("image", parameter_name="file")
async def say(ctx, file: Attachment)

It seems to have existed since 2.1, but was never documented.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@NeloBlivion NeloBlivion requested a review from a team as a code owner May 7, 2023 14:50
@Lulalaby Lulalaby merged commit 2abfa34 into Pycord-Development:master May 7, 2023
@pullapprove4
Copy link

pullapprove4 bot commented Jul 27, 2023

Please add a changelog entry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants