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

fix: enum option issues #2463

Merged
merged 12 commits into from
Jul 1, 2024
Merged

Conversation

NeloBlivion
Copy link
Member

@NeloBlivion NeloBlivion commented May 26, 2024

Summary

Makes two changes for better enum support in options:

  • If an enum's docstring is greater than 100 characters, truncate it (fixes issues on Python 3.11)
  • If an enum has more than 25 values, use basic_autocomplete instead of choices and forces the type back to string.

Related thread: https://discord.com/channels/881207955029110855/1238137800440942684/1238624044396314714

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.

@JustaSqu1d
Copy link
Member

It would be nice if this behavior was documented somewhere

@Lulalaby
Copy link
Member

What squid said

discord/commands/options.py Show resolved Hide resolved
discord/commands/options.py Outdated Show resolved Hide resolved
@Dorukyum
Copy link
Member

@NeloBlivion see suggestions

@Lulalaby Lulalaby enabled auto-merge (squash) July 1, 2024 11:33
@Lulalaby Lulalaby requested a review from Dorukyum July 1, 2024 11:33
@Lulalaby Lulalaby merged commit 99b40e2 into Pycord-Development:master Jul 1, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants