Add command that shows how many (& which) characters can be used for react

This commit is contained in:
Stijn De Clercq 2020-12-17 01:26:39 +01:00
parent c882179b0d
commit 9d3f71eb1f
3 changed files with 55 additions and 1 deletions

View file

@ -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