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

Improve Emoji.parse typing #1870

Merged
merged 1 commit into from
Apr 7, 2024
Merged

Improve Emoji.parse typing #1870

merged 1 commit into from
Apr 7, 2024

Conversation

beagold
Copy link
Contributor

@beagold beagold commented Apr 3, 2024

Summary

Found this while trying out the lib. Makes these situations nicer to handle:

emoji = hikari.Emoji.parse(emoji_str)

if isinstance(emoji, hikari.UnicodeEmoji):
    # Do something with UnicodeEmoji
else:
    # Do something with CustomEmoji
    #
    # Currently, the type of emoji here will be `Emoji`, which is quite unhelpful

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

None

@beagold beagold added the enhancement New feature or request label Apr 3, 2024
@beagold beagold self-assigned this Apr 3, 2024
@beagold beagold enabled auto-merge (squash) April 3, 2024 12:13
@beagold beagold merged commit af31e9b into master Apr 7, 2024
49 checks passed
@beagold beagold deleted the improve-emoji-parse-typing branch April 7, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants