This commit is contained in:
levina 2021-11-01 15:59:12 +07:00 committed by GitHub
parent 2f697c760c
commit 729a792d09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,6 @@
# Copyright (C) 2021 By VeezMusicProject # Copyright (C) 2021 By VeezMusicProject
from pyrogram import Client, filters from pyrogram import Client, filters
from program.admins import admin_only
from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup
from config import ( from config import (
ASSISTANT_NAME, ASSISTANT_NAME,
@ -164,8 +163,10 @@ async def cbsudo(_, query: CallbackQuery):
@Client.on_callback_query(filters.regex("cbmenu")) @Client.on_callback_query(filters.regex("cbmenu"))
@admin_only
async def cbmenu(_, query: CallbackQuery): async def cbmenu(_, query: CallbackQuery):
a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
if not a.can_manage_voice_chats:
return await query.answer("💡 only admin can tap this button !")
await query.edit_message_text( await query.edit_message_text(
"⚙️ **opened control menu panel**", "⚙️ **opened control menu panel**",
reply_markup=InlineKeyboardMarkup( reply_markup=InlineKeyboardMarkup(
@ -184,8 +185,9 @@ async def cbmenu(_, query: CallbackQuery):
) )
@Client.on_callback_query(filters.regex("cls")) @Client.on_callback_query(filters.regex("cls"))
@admin_only
async def close(_, query: CallbackQuery): async def close(_, query: CallbackQuery):
a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
if not a.can_manage_voice_chats:
return await query.answer("💡 only admin can tap this button !")
await query.message.delete() await query.message.delete()