diff --git a/program/callback.py b/program/callback.py index 501d2e5..296047e 100644 --- a/program/callback.py +++ b/program/callback.py @@ -1,7 +1,6 @@ # Copyright (C) 2021 By VeezMusicProject from pyrogram import Client, filters -from program.admins import admin_only from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup from config import ( ASSISTANT_NAME, @@ -164,8 +163,10 @@ async def cbsudo(_, query: CallbackQuery): @Client.on_callback_query(filters.regex("cbmenu")) -@admin_only 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( "⚙️ **opened control menu panel**", reply_markup=InlineKeyboardMarkup( @@ -184,8 +185,9 @@ async def cbmenu(_, query: CallbackQuery): ) - @Client.on_callback_query(filters.regex("cls")) -@admin_only 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()