I want to add reactions on a discord bot, but only some of my Emoji CLDR Short Names work.
For example:
If I use '\N{grinning face}' it works, '\N{thumbs up}' however does not. Instead it shows this message:
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-15: unknown Unicode character name
Same with '\N{green heart}' and '\N{red heart}'
I looked the CLDR Short Name up on the unicode.org page; are they just wrong or is it something else?
Escape sequence \N{name} = Character named name in the Unicode database. Use
'\N{thumbs up sign}'
'π'
Note that abovementioned link is to the last Unicode version (currently 13.0, I think) while your Python could use another one:
import unicodedata
unicodedata.unidata_version
'12.1.0'
FYI, excerpting from abovementioned UnicodeData.txt using the "\bheart\b" regex gives the following:
Char CodePoint Description
---- --------- -----------
β U+2619 Reversed Rotated Floral Heart Bullet
β‘ U+2661 White Heart Suit
β₯ U+2665 Black Heart Suit
β£ U+2763 Heavy Heart Exclamation Mark Ornament
β€ U+2764 Heavy Black Heart
β₯ U+2765 Rotated Heavy Black Heart Bullet
β¦ U+2766 Floral Heart
β§ U+2767 Rotated Floral Heart Bullet
βΊ U+2E96 CJK Radical Heart One
βΊ U+2E97 CJK Radical Heart Two
βΌΌ U+2F3C Kangxi Radical Heart
π U+1F394 HEART WITH TIP ON THE LEFT
π U+1F491 COUPLE WITH HEART
π U+1F493 BEATING HEART
π U+1F494 BROKEN HEART
π U+1F496 SPARKLING HEART
π U+1F497 GROWING HEART
π U+1F498 HEART WITH ARROW
π U+1F499 BLUE HEART
π U+1F49A GREEN HEART
π U+1F49B YELLOW HEART
π U+1F49C PURPLE HEART
π U+1F49D HEART WITH RIBBON
π U+1F49F HEART DECORATION
π€ U+1F5A4 BLACK HEART
π U+1F60D SMILING FACE WITH HEART-SHAPED EYES
π» U+1F63B SMILING CAT FACE WITH HEART-SHAPED EYES
π€ U+1F90D WHITE HEART
π€ U+1F90E BROWN HEART
π§‘ U+1F9E1 ORANGE HEART
π« U+1FAC0 ANATOMICAL HEART
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With