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: properly check if name is none for anno names #1555

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

AstreaTSS
Copy link
Member

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This fixes #1554 by properly checking if option.name is None. Previously, it was incorrectly assuming that name would be kept as None when passing it into the SlashCommandOption's init, when that doesn't seem to be the case (anymore? I swore this didn't happen before). Instead, it was a LocalisedName, and now the logic for the names accounts for that (and also properly sets the new name variable too).

Changes

See description.

Related Issues

#1554

Test Scenarios

@interactions.slash_command()
async def test(ctx: interactions.SlashContext, user: interactions.slash_user_option("e")):
    await ctx.send(user.mention)

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@LordOfPolls LordOfPolls merged commit 2d3c2c0 into interactions-py:unstable Sep 23, 2023
1 check passed
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