|
@@ -2,7 +2,7 @@ from wbb import app
|
|
|
from wbb.utils.errors import capture_err
|
|
from wbb.utils.errors import capture_err
|
|
|
from wbb.utils.fetch import fetch
|
|
from wbb.utils.fetch import fetch
|
|
|
from pyrogram import filters
|
|
from pyrogram import filters
|
|
|
-from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
|
|
|
|
|
|
+from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, InputMediaPhoto
|
|
|
|
|
|
|
|
|
|
|
|
|
BASE_URL = "https://rgprojectx-gogoanime.herokuapp.com"
|
|
BASE_URL = "https://rgprojectx-gogoanime.herokuapp.com"
|
|
@@ -49,7 +49,9 @@ async def anime_search(_, message):
|
|
|
if DATA_LEN == 0:
|
|
if DATA_LEN == 0:
|
|
|
await message.reply_text("**Found literally nothing.**")
|
|
await message.reply_text("**Found literally nothing.**")
|
|
|
return
|
|
return
|
|
|
- m = await app.send_message(
|
|
|
|
|
|
|
+ await m.delete()
|
|
|
|
|
+ m = await app.send_photo(
|
|
|
|
|
+ message.chat.id,
|
|
|
photo=data[RESULT_NUMBER]['thumbnail'],
|
|
photo=data[RESULT_NUMBER]['thumbnail'],
|
|
|
caption=f"**Title:** {data[RESULT_NUMBER]['title']}",
|
|
caption=f"**Title:** {data[RESULT_NUMBER]['title']}",
|
|
|
reply_markup=initial_keyboard
|
|
reply_markup=initial_keyboard
|
|
@@ -65,10 +67,10 @@ async def previous_callbacc(_, CallbackQuery):
|
|
|
show_alert=True
|
|
show_alert=True
|
|
|
)
|
|
)
|
|
|
return
|
|
return
|
|
|
- RESULT_NUMBER -= 0
|
|
|
|
|
|
|
+ RESULT_NUMBER -= 1
|
|
|
|
|
+ await m.edit_media(media=InputMediaPhoto(data[RESULT_NUMBER]['thumbnail']))
|
|
|
await m.edit(
|
|
await m.edit(
|
|
|
- photo=data[RESULT_NUMBER]['thumbnail'],
|
|
|
|
|
- caption=f"**Title:** {data[RESULT_NUMBER]['title']}",
|
|
|
|
|
|
|
+ f"**Title:** {data[RESULT_NUMBER]['title']}",
|
|
|
reply_markup=initial_keyboard
|
|
reply_markup=initial_keyboard
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -83,9 +85,9 @@ async def next_callbacc(_, CallbackQuery):
|
|
|
)
|
|
)
|
|
|
return
|
|
return
|
|
|
RESULT_NUMBER += 1
|
|
RESULT_NUMBER += 1
|
|
|
|
|
+ await m.edit_media(media=InputMediaPhoto(data[RESULT_NUMBER]['thumbnail']))
|
|
|
await m.edit(
|
|
await m.edit(
|
|
|
- photo=data[RESULT_NUMBER]['thumbnail'],
|
|
|
|
|
- caption=f"**Title:** {data[RESULT_NUMBER]['title']}",
|
|
|
|
|
|
|
+ f"**Title:** {data[RESULT_NUMBER]['title']}",
|
|
|
reply_markup=initial_keyboard
|
|
reply_markup=initial_keyboard
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -104,7 +106,17 @@ async def more_details_callbacc(_, CallbackQuery):
|
|
|
**Other Name:** __{data['other_name']}__
|
|
**Other Name:** __{data['other_name']}__
|
|
|
**Episodes:** __{len(data['episodes'])}__
|
|
**Episodes:** __{len(data['episodes'])}__
|
|
|
**Summary:** __{data['summary']}__"""
|
|
**Summary:** __{data['summary']}__"""
|
|
|
|
|
+ await m.edit_media(media=InputMediaPhoto(data['thumbnail']))
|
|
|
await m.edit(
|
|
await m.edit(
|
|
|
- photo=data['thumbnail'],
|
|
|
|
|
- caption=caption,
|
|
|
|
|
- keyboard=InlineKeyboardMarkup([[InlineKeyboardButton(text="Episode", callback_data="hoe")]])
|
|
|
|
|
|
|
+ caption,
|
|
|
|
|
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="Delete", callback_data="delete_message")]]))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+@app.on_callback_query(filters.regex("delete_message"))
|
|
|
|
|
+async def delete_callbacc(_, CallbackQuery):
|
|
|
|
|
+ global RESULT_NUMBER, data, DATA_LEN, m
|
|
|
|
|
+ RESULT_NUMBER = 0
|
|
|
|
|
+ data = None
|
|
|
|
|
+ DATA_LEN = 0
|
|
|
|
|
+ await m.delete()
|
|
|
|
|
+
|