1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 11:34:18 +00:00
royalnet/royalpack/commands/emojify.py

97 lines
2.6 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import random
import royalnet.engineer as engi
import royalpack.bolts as rb
_emojis = {
"abcd": ["🔡", "🔠"],
"back": ["🔙"],
"cool": ["🆒"],
"free": ["🆓"],
"1234": ["🔢"],
"abc": ["🔤"],
"atm": ["🏧"],
"new": ["🆕"],
"sos": ["🆘"],
"top": ["🔝"],
"zzz": ["💤"],
"end": ["🔚"],
"777": ["🎰"],
"100": ["💯"],
"ab": ["🆎"],
"cl": ["🆑"],
"id": ["🆔"],
"ng": ["🆖"],
"no": ["♑️"],
"ok": ["🆗"],
"on": ["🔛"],
"sy": ["💱"],
"tm": ["™️"],
"wc": ["🚾"],
"up": ["🆙"],
"!!": ["‼️"],
"!?": ["⁉️"],
"69": ["♋️"],
"24": ["🏪"],
"18": ["🔞"],
"10": ["🙌", "🔟", "🤲"],
"a": ["🅰️"],
"b": ["🅱️"],
"c": ["☪️", "©", "🥐"],
"d": ["🇩"],
"e": ["📧", "💶"],
"f": ["🎏"],
"g": ["🇬"],
"h": ["🏨", "🏩", "🏋‍♀", "🏋‍♂"],
"i": ["", "♊️", "🕕"],
"j": ["⤴️"],
"k": ["🎋", "🦅", "💃"],
"l": ["🛴", "🕒"],
"m": ["♏️", "Ⓜ️", "〽️"],
"n": ["📈"],
"o": ["⭕️", "🅾️", "📯", "🌝", "🌚", "🌕", "🥯", "🙆‍♀", "🙆‍♂"],
"p": ["🅿️"],
"q": ["🔍", "🍀", "🍭"],
"r": ["®"],
"s": ["💰", "💵", "💸", "💲"],
"t": ["✝️", "⬆️", "☦️"],
"u": ["", "⚓️", "🍉", "🌙", "🐋"],
"v": ["", "🔽", "☑️", "✔️"],
"w": ["🤷‍♀", "🤷‍♂", "🤾‍♀", "🤾‍♂", "🤽‍♀", "🤽‍♂"],
"x": ["🙅‍♀", "🙅‍♂", "", ""],
"y": ["💴"],
"z": ["⚡️"],
"*": ["*️⃣"],
"!": ["❗️", "", "⚠️"],
"?": ["", ""],
"9": ["9"],
"8": ["🎱", "8"],
"7": ["7"],
"6": ["6"],
"5": ["", "🤚", "👋", "5"],
"4": ["4"],
"3": ["🥉", "3"],
"2": ["✌️", "🤘", "🥈", "2"],
"1": ["👆", "☝️", "🖕", "🥇", "1"],
"0": ["⭕️", "🅾️", "📯", "🌝", "🌚", "🌕", "🥯", "🙆‍♀", "🙆‍♂", "0"],
"+": ["🏥"],
"/": ["🏒", "🧪", "🧹"],
"\\": ["🍢", "🍡", "🥄", "🌂"],
}
@rb.capture_errors
@engi.TeleportingConversation
async def emojify(*, _msg: engi.Message, message: str, **__):
"""
Converti un messaggio in emoji.
"""
message = message.lower()
for key in _emojis:
selected_emoji = random.sample(_emojis[key], 1)[0]
message = message.replace(key, selected_emoji)
await _msg.reply(text=message)
__all__ = ("emojify",)