Ejemplo n.º 1
0
    def __init__(self, bot: Red, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.bot = bot

        self.settings = PadInfoSettings("padinfo")

        self.index_all = None
        self.index_na = None

        self.menu = Menu(bot)

        # These emojis are the keys into the idmenu submenus
        self.id_emoji = '\N{INFORMATION SOURCE}'
        self.evo_emoji = char_to_emoji('e')
        self.mats_emoji = char_to_emoji('m')
        self.ls_emoji = '\N{INFORMATION SOURCE}'
        self.left_emoji = char_to_emoji('l')
        self.right_emoji = char_to_emoji('r')
        self.pantheon_emoji = '\N{CLASSICAL BUILDING}'
        self.skillups_emoji = '\N{MEAT ON BONE}'
        self.pic_emoji = '\N{FRAME WITH PICTURE}'
        self.other_info_emoji = '\N{SCROLL}'
        self.previous_monster_emoji = '\N{HEAVY MINUS SIGN}'
        self.next_monster_emoji = '\N{HEAVY PLUS SIGN}'
        self.remove_emoji = self.menu.emoji['no']

        self.historic_lookups_file_path = _data_file('historic_lookups.json')
        self.historic_lookups = safe_read_json(self.historic_lookups_file_path)

        self.historic_lookups_file_path_id2 = _data_file(
            'historic_lookups_id2.json')
        self.historic_lookups_id2 = safe_read_json(
            self.historic_lookups_file_path_id2)
Ejemplo n.º 2
0
 def __init__(self, bot, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.bot = bot
     self.card_data = []
     self.menu = Menu(bot)
     self.regular_emoji = char_to_emoji('r')
     self.idol_emoji = char_to_emoji('i')
Ejemplo n.º 3
0
 async def do_menu(self, ctx, c):
     emoji_to_embed = OrderedDict()
     for idx, image_info in enumerate(c['images']):
         emoji = char_to_emoji(str(idx))
         emoji_to_embed[emoji] = make_card_embed(c, idx)
     starting_menu_emoji = list(emoji_to_embed.keys())[0]
     return await self._do_menu(ctx, starting_menu_emoji, emoji_to_embed)
Ejemplo n.º 4
0
    async def _do_evolistmenu(self, ctx, sm):
        monsters = sm.alt_evos
        monsters.sort(key=lambda m: m.monster_id)

        emoji_to_embed = OrderedDict()
        for idx, m in enumerate(monsters):
            emoji = char_to_emoji(str(idx))
            emoji_to_embed[emoji] = monsterToEmbed(m, self.get_emojis())
            if m.monster_id == sm.monster_id:
                starting_menu_emoji = emoji

        return await self._do_menu(ctx, starting_menu_emoji, EmojiUpdater(emoji_to_embed), timeout=60)
Ejemplo n.º 5
0
    async def emoji(self, ctx, *, text):
        """Speak the provided text as emojis, deleting the original request"""
        await ctx.message.delete()
        new_msg = ""
        for char in text:
            if char.isalpha():
                new_msg += char_to_emoji(char) + ' '
            elif char == ' ':
                new_msg += '  '
            elif char.isspace():
                new_msg += char

        if len(new_msg):
            await ctx.send(new_msg)