Пример #1
0
async def view(bot: Amime, message: Message):
    content_type = message.matches[0]["content_type"]

    matches = re.search(r"(\d+)", message.text)
    message.matches = [matches]

    if content_type == "anime":
        await anime_view(bot, message)
    elif content_type == "character":
        await character_view(bot, message)
    else:
        await manga_view(bot, message)
Пример #2
0
    async def func(flt, client: Client, message: Message):
        value = message.text or message.caption

        if bool(value):
            command = value.split()[0]
            if "@" in command:
                b = command.split("@")[1]
                if b.lower() == client.me.username.lower():
                    value = (command.split("@")[0] +
                             (" " if len(value.split()) > 1 else "") +
                             " ".join(value.split()[1:]))

            message.matches = list(flt.p.finditer(value)) or None

        return bool(message.matches)
Пример #3
0
async def view(bot: Amime, message: Message):
    from_bot = message.via_bot

    if from_bot.id == bot.me.id:
        if bool(message.photo) and bool(message.caption):
            text = message.caption
            lines = text.splitlines()

            for line in lines:
                if "ID" in line:
                    matches = re.match(r"ID: (\d+) \((\w+)\)", line)
                    content_type = matches.group(2).lower()
                    message.matches = [matches]
                    if content_type == "anime":
                        await anime_view(bot, message)
                    elif content_type == "character":
                        await character_view(bot, message)
                    elif content_type == "manga":
                        await manga_view(bot, message)
                    break
Пример #4
0
async def on_list_commands_txt(c: Client, m: Message):
    m.matches = [{"page": 0}]
    await on_list_commands_u(c, m)