This commit is contained in:
yasir 2022-12-10 20:52:11 +07:00
parent b106bb79df
commit 8221672d76
2 changed files with 42 additions and 1 deletions

View file

@ -28,7 +28,7 @@ from misskaty.core.decorator.permissions import adminsOnly
__MODULE__ = "AFK"
__HELP__ = """/afk [Reason > Optional] - Tell others that you are AFK (Away From Keyboard), so that your boyfriend or girlfriend won't look for you 💔.
/afk [reply to media] - AFK with media.
/afkdel - Enable auto delete AFK message in group (Only for group admin).
/afkdel - Enable auto delete AFK message in group (Only for group admin). Default is **Enable**.
Just type something in group to remove AFK Status."""

View file

@ -75,6 +75,47 @@ async def ytdownv2(_, message):
await message.reply_photo(img, caption=caption, reply_markup=markup, quote=True)
@app.on_callback_query(filters.regex(r"^yt_listall"))
async def ytdl_listall_callback(_, cq: CallbackQuery):
if cq.from_user.id != cq.message.reply_to_message.from_user.id:
return await cq.answer("Not your task", True)
callback = cq.data.split("|")
async with iYTDL(
log_group_id=0, cache_path="cache", ffmpeg_location="/usr/bin/mediaextract"
) as ytdl:
media, buttons = await ytdl.listview(callback[1])
await cq.edit_message_media(
media=media, reply_markup=buttons.add(cq.from_user.id)
)
@app.on_callback_query(filters.regex(r"^yt_extract_info"))
async def ytdl_extractinfo_callback(_, cq: CallbackQuery):
if cq.from_user.id != cq.message.reply_to_message.from_user.id:
return await cq.answer("Not your task", True)
await c_q.answer("Please Wait...")
callback = cq.data.split("|")
async with iYTDL(
log_group_id=0, cache_path="cache", ffmpeg_location="/usr/bin/mediaextract"
) as ytdl:
if data := await ytdl.extract_info_from_key(callback[1]):
if len(key) == 11:
await cq.edit_message_text(
text=data.caption,
reply_markup=data.buttons.add(cq.from_user.id),
)
else:
await cq.edit_message_media(
media=(
InputMediaPhoto(
media=data.image_url,
caption=data.caption,
)
),
reply_markup=data.buttons.add(cq.from_user.id),
)
@app.on_callback_query(filters.regex(r"^yt_(gen|dl)"))
async def ytdl_gendl_callback(_, cq: CallbackQuery):
if cq.from_user.id != cq.message.reply_to_message.from_user.id: