コード例 #1
0
ファイル: anime_search.py プロジェクト: Shshshhj/Pepe
async def manga(message):
    search_query = message.pattern_match.group(1)
    await message.get_reply_message()
    await message.edit("`Searching Manga..`")
    jikan = jikanpy.jikan.Jikan()
    search_result = jikan.search("manga", search_query)
    first_mal_id = search_result["results"][0]["mal_id"]
    caption, image = get_anime_manga(first_mal_id, "anime_manga", message.chat_id)
    await message.client.send_file(
        message.chat_id, file=image, caption=caption, parse_mode="HTML"
    )
    await message.delete()
コード例 #2
0
ファイル: anime_search.py プロジェクト: Shshshhj/Pepe
async def anime(message):
    search_query = message.pattern_match.group(1)
    await message.get_reply_message()
    await message.edit("`Searching Anime..`")
    jikan = jikanpy.jikan.Jikan()
    search_result = jikan.search("anime", search_query)
    first_mal_id = search_result["results"][0]["mal_id"]
    caption, image = get_anime_manga(first_mal_id, "anime_anime", message.chat_id)
    try:
        await message.client.send_file(
            message.chat_id, file=image, caption=caption, parse_mode="HTML"
        )
    except BaseException:
        image = getBannerLink(first_mal_id, False)
        await message.client.send_file(
            message.chat_id, file=image, caption=caption, parse_mode="HTML"
        )
    await message.delete()