This commit is contained in:
yasir 2023-01-11 13:21:08 +07:00
parent c9feae5e7a
commit 0e3f57ac7a
2 changed files with 27 additions and 0 deletions

View file

@ -7,6 +7,7 @@ from pyrogram.errors import PeerIdInvalid, UserNotParticipant
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from misskaty import app
from .web_scraper import PTL_DICT
from misskaty.core.decorator.errors import capture_err
from misskaty.helper.time_gap import check_time_gap
@ -105,6 +106,7 @@ async def request_user(client, message):
async def clear_reqdict():
PTL_DICT.clear()
REQUEST_DB.clear()

View file

@ -238,4 +238,29 @@ async def lk21page_callback(client, callback_query):
keyboard.row(
InlineButton("❌ Close", f"close#{callback_query.from_user.id}")
)
await editPesan(callback_query.message, lkres, reply_markup=keyboard)
# Lk21 Page Callback
@app.on_callback_query(filters.create(lambda _, __, query: 'page_pahe#' in query.data))
async def pahepage_callback(client, callback_query):
if callback_query.from_user.id != int(callback_query.data.split('#')[3]):
return await callback_query.answer("Not yours..", True)
message_id = int(callback_query.data.split('#')[2])
chat_id = callback_query.message.chat.id
CurrentPage = int(callback_query.data.split('#')[1])
try:
kueri = PTL_DICT[message_id][1]
except KeyError:
return await callback_query.answer("Invalid callback data, please send CMD again..")
try:
lkres, PageLen = await getDataPahe(chat_id, message_id, kueri, CurrentPage)
except TypeError:
return
keyboard = InlineKeyboard()
keyboard.paginate(PageLen, CurrentPage, 'page_pahe#{number}' + f'#{message_id}#{callback_query.from_user.id}')
keyboard.row(
InlineButton("❌ Close", f"close#{callback_query.from_user.id}")
)
await editPesan(callback_query.message, lkres, reply_markup=keyboard)