mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-05 11:44:50 +00:00
fix
This commit is contained in:
parent
c9feae5e7a
commit
0e3f57ac7a
2 changed files with 27 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ from pyrogram.errors import PeerIdInvalid, UserNotParticipant
|
||||||
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
||||||
|
|
||||||
from misskaty import app
|
from misskaty import app
|
||||||
|
from .web_scraper import PTL_DICT
|
||||||
from misskaty.core.decorator.errors import capture_err
|
from misskaty.core.decorator.errors import capture_err
|
||||||
from misskaty.helper.time_gap import check_time_gap
|
from misskaty.helper.time_gap import check_time_gap
|
||||||
|
|
||||||
|
|
@ -105,6 +106,7 @@ async def request_user(client, message):
|
||||||
|
|
||||||
|
|
||||||
async def clear_reqdict():
|
async def clear_reqdict():
|
||||||
|
PTL_DICT.clear()
|
||||||
REQUEST_DB.clear()
|
REQUEST_DB.clear()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -238,4 +238,29 @@ async def lk21page_callback(client, callback_query):
|
||||||
keyboard.row(
|
keyboard.row(
|
||||||
InlineButton("❌ Close", f"close#{callback_query.from_user.id}")
|
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)
|
await editPesan(callback_query.message, lkres, reply_markup=keyboard)
|
||||||
Loading…
Reference in a new issue