mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Add command that shows how many (& which) characters can be used for react
This commit is contained in:
parent
c882179b0d
commit
9d3f71eb1f
3 changed files with 55 additions and 1 deletions
|
|
@ -259,4 +259,38 @@ def getUnicodeDict():
|
|||
"asterisk": "*️⃣"
|
||||
}
|
||||
|
||||
return unidic
|
||||
return unidic
|
||||
|
||||
|
||||
# Returns a list of all emoji's that exist for a char
|
||||
def getAllVariants(char: str):
|
||||
variants = []
|
||||
|
||||
# Letter
|
||||
reg_ind = "regional_indicator_{}".format(char)
|
||||
if reg_ind in getUnicodeDict():
|
||||
variants.append(reg_ind)
|
||||
|
||||
# Number
|
||||
elif char in getNumbers():
|
||||
variants.append(getNumbers()[char])
|
||||
|
||||
# Special Character
|
||||
elif char in getSpecialCharacters():
|
||||
variants.append(getSpecialCharacters()[char])
|
||||
|
||||
# Get all doubles
|
||||
if char in getDoubles():
|
||||
for letter in getDoubles()[char]:
|
||||
variants.append(letter)
|
||||
|
||||
# Remove doubles that might have slipped in
|
||||
# Use a list here to keep the order!
|
||||
uniques = []
|
||||
|
||||
for var in variants:
|
||||
rep = ":" + var + ":"
|
||||
if rep not in uniques:
|
||||
uniques.append(rep)
|
||||
|
||||
return uniques
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue