pycord icon indicating copy to clipboard operation
pycord copied to clipboard

PartialEmoji.is_unicode_emoji() returns True even for non-emojis

Open KosmicAnomaly opened this issue 3 years ago • 4 comments

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

KosmicAnomaly avatar Jan 10 '22 05:01 KosmicAnomaly

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.

plun1331 avatar Jan 10 '22 17:01 plun1331

I tried just using the emoji library, but that doesnt include emojis like :regional_indicator_b:

KosmicAnomaly avatar Jan 10 '22 18:01 KosmicAnomaly

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)

cactusdualcore avatar Feb 13 '22 18:02 cactusdualcore

Status Update please @Pycord-Development/maintainers

Lulalaby avatar Sep 23 '22 00:09 Lulalaby

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.

Dorukyum avatar Dec 01 '23 09:12 Dorukyum