pycord
pycord copied to clipboard
PartialEmoji.is_unicode_emoji() returns True even for non-emojis
Summary
PartialEmoji.is_unicode_emoji() returns True even for non-emojis
Reproduction Steps
Send a random string into PartialEmoji.from_str() and run is_unicode_emoji() on it
Minimal Reproducible Code
emojiObj = PartialEmoji.from_str("BBBBBBBBBBBBBBBBBBB")
print(emojiObj)
print(emojiObj.is_unicode_emoji())
Expected Results
Return False
Actual Results
Return True
Intents
discord.Intents.all()
System Information
- Python v3.9.7-final
- py-cord v2.0.0-alpha
- py-cord pkg_resources: v2.0.0a4757+g02e346db
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.22000
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
No response
It seems to be that there isn't any check to see that the emoji actually exists, just that it isn't a custom emoji.
I tried just using the emoji library, but that doesnt include emojis like :regional_indicator_b:
I tried just using the emoji library, but that doesnt include emojis like :regional_indicator_b:
This does make sense to some extend, as Regional Indicator Symbol Letters are not emojis as understood by Unicode. Desired behavior could be achieved by checking whether is a Unicode emoji or code point is a regional indicators. Though this method deviates from Unicode which might be misleading together with its name. Note that discord has two icons for any icon (A backslash right before the actual emoji changes the icon)
Status Update please @Pycord-Development/maintainers
PartialEmojis are sent by Discord. The class is not supposed to be used by developers to check whether a string is an emoji or not.