This commit is contained in:
levina 2021-11-12 06:30:14 +07:00 committed by GitHub
parent bd062ffdc3
commit c1b3ac447f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
# Copyright (C) 2021 By VeezMusicProject # Copyright (C) 2021 By VeezMusicProject
from pyrogram import Client, filters from pyrogram import Client, filters
from driver.queues import QUEUE
from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup
from config import ( from config import (
ASSISTANT_NAME, ASSISTANT_NAME,
@ -170,21 +171,26 @@ async def cbmenu(_, query: CallbackQuery):
a = await _.get_chat_member(query.message.chat.id, query.from_user.id) a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
if not a.can_manage_voice_chats: if not a.can_manage_voice_chats:
return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True)
await query.edit_message_text( chat_id = query.message.chat.id
f"⚙️ **settings of** {query.message.chat.title}\n\n⏸ : pause stream\n▶️ : resume stream\n🔇 : mute userbot\n🔊 : unmute userbot\n⏹ : stop stream", if chat_id in QUEUE:
reply_markup=InlineKeyboardMarkup( try:
[[ await query.edit_message_text(
InlineKeyboardButton("", callback_data="cbstop"), f"⚙️ **settings of** {query.message.chat.title}\n\n⏸ : pause stream\n▶️ : resume stream\n🔇 : mute userbot\n🔊 : unmute userbot\n⏹ : stop stream",
InlineKeyboardButton("", callback_data="cbpause"), reply_markup=InlineKeyboardMarkup(
InlineKeyboardButton("▶️", callback_data="cbresume"), [[
],[ InlineKeyboardButton("", callback_data="cbstop"),
InlineKeyboardButton("🔇", callback_data="cbmute"), InlineKeyboardButton("", callback_data="cbpause"),
InlineKeyboardButton("🔊", callback_data="cbunmute"), InlineKeyboardButton("▶️", callback_data="cbresume"),
],[ ],[
InlineKeyboardButton("🗑 Close", callback_data="cls")], InlineKeyboardButton("🔇", callback_data="cbmute"),
] InlineKeyboardButton("🔊", callback_data="cbunmute"),
), ],[
) InlineKeyboardButton("🗑 Close", callback_data="cls")],
]
),
)
else:
await query.answer("❌ nothing is currently streaming", show_alert=True)
@Client.on_callback_query(filters.regex("cls")) @Client.on_callback_query(filters.regex("cls"))