1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +00:00
royalnet/royalpack/commands/emojify.py

97 lines
2.9 KiB
Python
Raw Normal View History

2019-11-11 08:56:08 +00:00
import random
from royalnet.commands import *
class EmojifyCommand(Command):
name: str = "emojify"
description: str = "Converti un messaggio in emoji."
syntax = "{messaggio}"
_emojis = {
"abcd": ["🔡", "🔠"],
"back": ["🔙"],
"cool": ["🆒"],
"free": ["🆓"],
"abc": ["🔤"],
"atm": ["🏧"],
"new": ["🆕"],
"sos": ["🆘"],
"top": ["🔝"],
"zzz": ["💤"],
"end": ["🔚"],
"ab": ["🆎"],
"cl": ["🆑"],
"id": ["🆔"],
"ng": ["🆖"],
"no": ["♑️"],
"ok": ["🆗"],
"on": ["🔛"],
"sy": ["💱"],
"tm": ["™️"],
"wc": ["🚾"],
"up": ["🆙"],
"a": ["🅰️"],
"b": ["🅱️"],
"c": ["☪️", "©", "🥐"],
"d": ["🇩"],
"e": ["📧", "💶"],
"f": ["🎏"],
"g": ["🇬"],
"h": ["🏨", "🏩", "🏋‍♀", "🏋‍♂"],
"i": ["", "♊️", "🕕"],
"j": ["⤴️"],
"k": ["🎋", "🦅", "💃"],
"l": ["🛴", "🕒"],
"m": ["♏️", "Ⓜ️", "〽️"],
"n": ["📈"],
"o": ["⭕️", "🅾️", "📯", "🌝", "🌚", "🌕", "🥯", "🙆‍♀", "🙆‍♂"],
"p": ["🅿️"],
"q": ["🔍", "🍀", "🍭"],
2019-11-11 08:56:08 +00:00
"r": ["®"],
"s": ["💰", "💵", "💸", "💲"],
"t": ["✝️", "⬆️", "☦️"],
"u": ["", "⚓️", "🍉", "🌙", "🐋"],
"v": ["", "🔽", "☑️", "✔️"],
"w": ["🤷‍♀", "🤷‍♂", "🤾‍♀", "🤾‍♂", "🤽‍♀", "🤽‍♂"],
"x": ["🙅‍♀", "🙅‍♂", "", ""],
"y": ["💴"],
"z": ["⚡️"],
"1234":["🔢"],
"777":["🎰"],
"100":["💯"],
"69":["♋️"],
"24":["🏪"],
"18":["🔞"],
"10":["🙌", "🔟", "🤲"],
#9 manca
"8":["🎱"],
#7 manca
#6 manca
"5":["", "🤚","👋"],
#4 manca
"3":["🥉"],
"2":["✌️", "🤘", "🥈"],
"1":["👆", "☝️", "🖕", "🥇"],
"0":["⭕️", "🅾️", "📯", "🌝", "🌚", "🌕", "🥯", "🙆‍♀", "🙆‍♂"],
"+":["🏥"],
"/":["🏒", "🧪", "🧹"],
"\":["🍢", "🍡", "🥄", "🌂"],
"*":["✳️"]
2019-11-11 08:56:08 +00:00
}
@classmethod
def _emojify(cls, string: str):
new_string = string.lower()
for key in cls._emojis:
selected_emoji = random.sample(cls._emojis[key], 1)[0]
new_string = new_string.replace(key, selected_emoji)
return new_string
async def run(self, args: CommandArgs, data: CommandData) -> None:
string = args.joined(require_at_least=1)
await data.reply(self._emojify(string))