diff --git a/royalnet/packs/royal/commands/__init__.py b/royalnet/packs/royal/commands/__init__.py index 33d908ab..5f48eb8a 100644 --- a/royalnet/packs/royal/commands/__init__.py +++ b/royalnet/packs/royal/commands/__init__.py @@ -21,6 +21,7 @@ from .summon import SummonCommand from .youtube import YoutubeCommand from .soundcloud import SoundcloudCommand from .zawarudo import ZawarudoCommand +from .emojify import EmojifyCommand # Enter the commands of your Pack here! available_commands = [ @@ -45,7 +46,8 @@ available_commands = [ SummonCommand, YoutubeCommand, SoundcloudCommand, - ZawarudoCommand + ZawarudoCommand, + EmojifyCommand, ] # Don't change this, it should automatically generate __all__ diff --git a/royalnet/packs/royal/commands/emojify.py b/royalnet/packs/royal/commands/emojify.py new file mode 100644 index 00000000..acd7177e --- /dev/null +++ b/royalnet/packs/royal/commands/emojify.py @@ -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))