mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Add emojify command?
This commit is contained in:
parent
4c09e946d1
commit
c7ebfe3622
2 changed files with 76 additions and 1 deletions
|
@ -21,6 +21,7 @@ from .summon import SummonCommand
|
||||||
from .youtube import YoutubeCommand
|
from .youtube import YoutubeCommand
|
||||||
from .soundcloud import SoundcloudCommand
|
from .soundcloud import SoundcloudCommand
|
||||||
from .zawarudo import ZawarudoCommand
|
from .zawarudo import ZawarudoCommand
|
||||||
|
from .emojify import EmojifyCommand
|
||||||
|
|
||||||
# Enter the commands of your Pack here!
|
# Enter the commands of your Pack here!
|
||||||
available_commands = [
|
available_commands = [
|
||||||
|
@ -45,7 +46,8 @@ available_commands = [
|
||||||
SummonCommand,
|
SummonCommand,
|
||||||
YoutubeCommand,
|
YoutubeCommand,
|
||||||
SoundcloudCommand,
|
SoundcloudCommand,
|
||||||
ZawarudoCommand
|
ZawarudoCommand,
|
||||||
|
EmojifyCommand,
|
||||||
]
|
]
|
||||||
|
|
||||||
# Don't change this, it should automatically generate __all__
|
# Don't change this, it should automatically generate __all__
|
||||||
|
|
73
royalnet/packs/royal/commands/emojify.py
Normal file
73
royalnet/packs/royal/commands/emojify.py
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
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": ["🔍", "🍀"],
|
||||||
|
"r": ["®"],
|
||||||
|
"s": ["💰", "💵", "💸", "💲"],
|
||||||
|
"t": ["✝️", "⬆️", "☦️"],
|
||||||
|
"u": ["⛎", "⚓️", "🍉", "🌙", "🐋"],
|
||||||
|
"v": ["✅", "🔽", "☑️", "✔️"],
|
||||||
|
"w": ["🤷♀", "🤷♂", "🤾♀", "🤾♂", "🤽♀", "🤽♂"],
|
||||||
|
"x": ["🙅♀", "🙅♂", "❌", "❎"],
|
||||||
|
"y": ["💴"],
|
||||||
|
"z": ["⚡️"]
|
||||||
|
}
|
||||||
|
|
||||||
|
@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))
|
Loading…
Reference in a new issue