diff --git a/program/playlist.py b/program/playlist.py index bbff82d..c8d9453 100644 --- a/program/playlist.py +++ b/program/playlist.py @@ -3,19 +3,29 @@ # Finished On 28/10/2021 from config import BOT_USERNAME -from pyrogram.types import Message +from pyrogram.types import ( + CallbackQuery, + InlineKeyboardButton, + InlineKeyboardMarkup, + Message, +) from pyrogram import Client, filters from driver.queues import QUEUE, get_queue from driver.filters import command, other_filters +keyboard = InlineKeyboardMarkup( + [[InlineKeyboardButton("šŸ—‘ Close", callback_data="cls")]] +) + + @Client.on_message(command(["playlist", f"playlist@{BOT_USERNAME}", "queue", f"queue@{BOT_USERNAME}"]) & other_filters) async def playlist(client, m: Message): chat_id = m.chat.id if chat_id in QUEUE: chat_queue = get_queue(chat_id) if len(chat_queue)==1: - await m.reply(f"šŸ’” **Currently Streaming:**\n\nā€¢ [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}`", disable_web_page_preview=True) + await m.reply(f"šŸ’” **Currently Streaming:**\n\nā€¢ [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}`", reply_markup=keyboard) else: QUE = f"šŸ’” **Currently Streaming:**\n\nā€¢ [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}` \n\n**šŸ“– Queue List:**\n" l = len(chat_queue) @@ -24,6 +34,6 @@ async def playlist(client, m: Message): hok = chat_queue[x][2] hap = chat_queue[x][3] QUE = QUE + "\n" + f"**#{x}** - [{han}]({hok}) | `{hap}`" - await m.reply(QUE, disable_web_page_preview=True) + await m.reply(QUE, reply_markup=keyboard) else: await m.reply("āŒ **nothing is currently streaming.**")