From 1ead8220da4ec24ef96c354c4ee3f98a26577ca8 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 14:56:12 +0700 Subject: [PATCH 01/13] added control button control the admin tools using button --- program/admins.py | 109 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/program/admins.py b/program/admins.py index 6ff8459..da783dd 100644 --- a/program/admins.py +++ b/program/admins.py @@ -1,3 +1,4 @@ +from typing import Callable from cache.admins import admins from driver.veez import call_py from pyrogram import Client, filters @@ -6,7 +7,34 @@ from driver.filters import command, other_filters from driver.queues import QUEUE, clear_queue from driver.utils import skip_current_song, skip_item from config import BOT_USERNAME, GROUP_SUPPORT, IMG_3, UPDATES_CHANNEL -from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message +from pyrogram.types import ( + CallbackQuery, + InlineKeyboardButton, + InlineKeyboardMarkup, + Message, +) + + +def admin_only(func: Callable) -> Callable: + async def decorator(client, cb): + author = admins.get(cb.message.chat.id) + if cb.from_user.id in author: + return await func(client, cb) + else: + await cb.answer("💡 only admin can tap this button !", show_alert=True) + return + + return decorator + + +bttn = InlineKeyboardMarkup( + [[InlineKeyboardButton("🔙 Go Back", callback_data="cbback")]] +) + + +bcl = InlineKeyboardMarkup( + [[InlineKeyboardButton("🗑 Close", callback_data="cls")]] +) @Client.on_message(command(["reload", f"reload@{BOT_USERNAME}"]) & other_filters) @@ -161,6 +189,85 @@ async def unmute(client, m: Message): await m.reply("❌ **nothing in streaming**") +@Client.on_callback_query(filters.regex("cbpause")) +@admin_only +async def cbpause(_, query: CallbackQuery): + chat_id = query.message.chat.id + if chat_id in QUEUE: + try: + await call_py.pause_stream(chat_id) + await query.edit_message_text( + "⏸ streaming is paused", reply_markup=bttn + ) + except Exception as e: + await query.edit_message_text(f"🚫 **error:**\n\n`{e}`", reply_markup=bcl) + else: + await query.edit_message_text("❌ **nothing in streaming**", reply_markup=bcl) + + +@Client.on_callback_query(filters.regex("cbresume")) +@admin_only +async def cbresume(_, query: CallbackQuery): + chat_id = query.message.chat.id + if chat_id in QUEUE: + try: + await call_py.resume_stream(chat_id) + await query.edit_message_text( + "▶️ streaming is resumed", reply_markup=bttn + ) + except Exception as e: + await query.edit_message_text(f"🚫 **error:**\n\n`{e}`", reply_markup=bcl) + else: + await query.edit_message_text("❌ **nothing in streaming**", reply_markup=bcl) + + +@Client.on_callback_query(filters.regex("cbstop")) +@admin_only +async def cbstop(_, query: CallbackQuery): + chat_id = query.message.chat.id + if chat_id in QUEUE: + try: + await call_py.leave_group_call(chat_id) + clear_queue(chat_id) + await query.edit_message_text("✅ **streaming has ended**", reply_markup=bcl) + except Exception as e: + await query.edit_message_text(f"🚫 **error:**\n\n`{e}`", reply_markup=bcl) + else: + await query.edit_message_text("❌ **nothing in streaming**", reply_markup=bcl) + + +@Client.on_callback_query(filters.regex("cbmute")) +@admin_only +async def cbmute(_, query: CallbackQuery): + chat_id = query.message.chat.id + if chat_id in QUEUE: + try: + await call_py.mute_stream(chat_id) + await query.edit_message_text( + "🔇 userbot succesfully muted", reply_markup=bttn + ) + except Exception as e: + await query.edit_message_text(f"🚫 **error:**\n\n`{e}`", reply_markup=bcl) + else: + await query.edit_message_text("❌ **nothing in streaming**", reply_markup=bcl) + + +@Client.on_callback_query(filters.regex("cbunmute")) +@admin_only +async def cbunmute(_, query: CallbackQuery): + chat_id = query.message.chat.id + if chat_id in QUEUE: + try: + await call_py.unmute_stream(chat_id) + await query.edit_message_text( + "🔊 userbot succesfully unmuted", reply_markup=bttn + ) + except Exception as e: + await query.edit_message_text(f"🚫 **error:**\n\n`{e}`", reply_markup=bcl) + else: + await query.edit_message_text("❌ **nothing in streaming**", reply_markup=bcl) + + @Client.on_message( command(["volume", f"volume@{BOT_USERNAME}", "vol"]) & other_filters ) From 26d8dad8c1ebb8ed12eb9072f623eed4f75ce3ff Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:07:47 +0700 Subject: [PATCH 02/13] added control button --- program/callback.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/program/callback.py b/program/callback.py index ab9a608..501d2e5 100644 --- a/program/callback.py +++ b/program/callback.py @@ -1,6 +1,7 @@ # 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, @@ -162,6 +163,29 @@ async def cbsudo(_, query: CallbackQuery): ) +@Client.on_callback_query(filters.regex("cbmenu")) +@admin_only +async def cbmenu(_, query: CallbackQuery): + await query.edit_message_text( + "⚙️ **opened control menu panel**", + reply_markup=InlineKeyboardMarkup( + [[ + InlineKeyboardButton("⏸ pause", callback_data="cbpause"), + InlineKeyboardButton("▶️ resume", callback_data="cbresume"), + ],[ + InlineKeyboardButton("🔇 mute", callback_data="cbmute"), + InlineKeyboardButton("🔊 unmute", callback_data="cbunmute"), + ],[ + InlineKeyboardButton("⏹ stop stream", callback_data="cbstop"), + ],[ + InlineKeyboardButton("🗑 Close", callback_data="cls")], + ] + ), + ) + + + @Client.on_callback_query(filters.regex("cls")) +@admin_only async def close(_, query: CallbackQuery): await query.message.delete() From 149da0b76d68c011c9b099d9de932c4f423ed5d2 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:13:31 +0700 Subject: [PATCH 03/13] fixes --- program/admins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/admins.py b/program/admins.py index da783dd..1b9c370 100644 --- a/program/admins.py +++ b/program/admins.py @@ -28,7 +28,7 @@ def admin_only(func: Callable) -> Callable: bttn = InlineKeyboardMarkup( - [[InlineKeyboardButton("🔙 Go Back", callback_data="cbback")]] + [[InlineKeyboardButton("🔙 Go Back", callback_data="cbmenu")]] ) @@ -59,10 +59,10 @@ async def skip(client, m: Message): [ [ InlineKeyboardButton( - text="✨ ɢʀᴏᴜᴘ", url=f"https://t.me/{GROUP_SUPPORT}" + text="• Mᴇɴᴜ", callback_data="cbmenu" ), InlineKeyboardButton( - text="🌻 ᴄʜᴀɴɴᴇʟ", url=f"https://t.me/{UPDATES_CHANNEL}" + text="• Cʟᴏsᴇ", callback_data="cls" ), ] ] From 4a9308018a244f9ccaea3ac38f0f823fbd22cf8d Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:16:06 +0700 Subject: [PATCH 04/13] change button --- program/music.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program/music.py b/program/music.py index 0ea7bf3..f0afd6f 100644 --- a/program/music.py +++ b/program/music.py @@ -56,10 +56,10 @@ async def play(_, m: Message): [ [ InlineKeyboardButton( - text="✨ ɢʀᴏᴜᴘ", url=f"https://t.me/{GROUP_SUPPORT}" + text="• Mᴇɴᴜ", callback_data="cbmenu" ), InlineKeyboardButton( - text="🌻 ᴄʜᴀɴɴᴇʟ", url=f"https://t.me/{UPDATES_CHANNEL}" + text="• Cʟᴏsᴇ", callback_data="cls" ), ] ] @@ -207,10 +207,10 @@ async def stream(_, m: Message): [ [ InlineKeyboardButton( - text="✨ ɢʀᴏᴜᴘ", url=f"https://t.me/{GROUP_SUPPORT}" + text="• Mᴇɴᴜ", callback_data="cbmenu" ), InlineKeyboardButton( - text="🌻 ᴄʜᴀɴɴᴇʟ", url=f"https://t.me/{UPDATES_CHANNEL}" + text="• Cʟᴏsᴇ", callback_data="cls" ), ] ] From 3c6b9b65390f3f01c4f6f77a1a7903e22548dd43 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:16:52 +0700 Subject: [PATCH 05/13] change button --- program/video.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program/video.py b/program/video.py index 92cca52..934a93a 100644 --- a/program/video.py +++ b/program/video.py @@ -62,10 +62,10 @@ async def vplay(client, m: Message): [ [ InlineKeyboardButton( - text="✨ ɢʀᴏᴜᴘ", url=f"https://t.me/{GROUP_SUPPORT}" + text="• Mᴇɴᴜ", callback_data="cbmenu" ), InlineKeyboardButton( - text="🌻 ᴄʜᴀɴɴᴇʟ", url=f"https://t.me/{UPDATES_CHANNEL}" + text="• Cʟᴏsᴇ", callback_data="cls" ), ] ] @@ -224,10 +224,10 @@ async def vstream(client, m: Message): [ [ InlineKeyboardButton( - text="✨ ɢʀᴏᴜᴘ", url=f"https://t.me/{GROUP_SUPPORT}" + text="• Mᴇɴᴜ", callback_data="cbmenu" ), InlineKeyboardButton( - text="🌻 ᴄʜᴀɴɴᴇʟ", url=f"https://t.me/{UPDATES_CHANNEL}" + text="• Cʟᴏsᴇ", callback_data="cls" ), ] ] From 2f697c760c0cfd8c31b670af489baa5ea0fb7b51 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:57:52 +0700 Subject: [PATCH 06/13] fixes error `NoneType` object --- program/admins.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/program/admins.py b/program/admins.py index 1b9c370..e83e8a2 100644 --- a/program/admins.py +++ b/program/admins.py @@ -1,4 +1,3 @@ -from typing import Callable from cache.admins import admins from driver.veez import call_py from pyrogram import Client, filters @@ -15,18 +14,6 @@ from pyrogram.types import ( ) -def admin_only(func: Callable) -> Callable: - async def decorator(client, cb): - author = admins.get(cb.message.chat.id) - if cb.from_user.id in author: - return await func(client, cb) - else: - await cb.answer("💡 only admin can tap this button !", show_alert=True) - return - - return decorator - - bttn = InlineKeyboardMarkup( [[InlineKeyboardButton("🔙 Go Back", callback_data="cbmenu")]] ) @@ -190,8 +177,10 @@ async def unmute(client, m: Message): @Client.on_callback_query(filters.regex("cbpause")) -@admin_only async def cbpause(_, 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 !") chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -206,8 +195,10 @@ async def cbpause(_, query: CallbackQuery): @Client.on_callback_query(filters.regex("cbresume")) -@admin_only async def cbresume(_, 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 !") chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -222,8 +213,10 @@ async def cbresume(_, query: CallbackQuery): @Client.on_callback_query(filters.regex("cbstop")) -@admin_only async def cbstop(_, 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 !") chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -237,8 +230,10 @@ async def cbstop(_, query: CallbackQuery): @Client.on_callback_query(filters.regex("cbmute")) -@admin_only async def cbmute(_, 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 !") chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -253,8 +248,10 @@ async def cbmute(_, query: CallbackQuery): @Client.on_callback_query(filters.regex("cbunmute")) -@admin_only async def cbunmute(_, 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 !") chat_id = query.message.chat.id if chat_id in QUEUE: try: From 729a792d0958b16f3373b1b93fce22edaffd92bf Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:59:12 +0700 Subject: [PATCH 07/13] fixes --- program/callback.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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() From 6f122dac412e5e90bceadb65bc5dabc9673aff23 Mon Sep 17 00:00:00 2001 From: Shohih Abdul <50512936+DoellBarr@users.noreply.github.com> Date: Mon, 1 Nov 2021 16:50:46 +0700 Subject: [PATCH 08/13] spesific the answer --- program/callback.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program/callback.py b/program/callback.py index 296047e..19f2db5 100644 --- a/program/callback.py +++ b/program/callback.py @@ -166,7 +166,7 @@ async def cbsudo(_, 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 !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") await query.edit_message_text( "⚙️ **opened control menu panel**", reply_markup=InlineKeyboardMarkup( @@ -189,5 +189,5 @@ async def cbmenu(_, 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 !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") await query.message.delete() From bf369f5c558c57afbc73cc89ce5cb1cd488377c1 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:24:42 +0700 Subject: [PATCH 09/13] change button --- program/callback.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/program/callback.py b/program/callback.py index 19f2db5..e48ac0d 100644 --- a/program/callback.py +++ b/program/callback.py @@ -168,16 +168,15 @@ async def cbmenu(_, query: CallbackQuery): if not a.can_manage_voice_chats: return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") await query.edit_message_text( - "⚙️ **opened control menu panel**", + f"⚙️ **settings of** {query.message.chat.title}\n\n**⏸ pause || ▶️ resume**\n**🔇 mute || 🔊 unmute**\n**⏹ stop stream**", reply_markup=InlineKeyboardMarkup( [[ - InlineKeyboardButton("⏸ pause", callback_data="cbpause"), - InlineKeyboardButton("▶️ resume", callback_data="cbresume"), + InlineKeyboardButton("⏹", callback_data="cbstop"), + InlineKeyboardButton("⏸", callback_data="cbpause"), + InlineKeyboardButton("▶️", callback_data="cbresume"), ],[ - InlineKeyboardButton("🔇 mute", callback_data="cbmute"), - InlineKeyboardButton("🔊 unmute", callback_data="cbunmute"), - ],[ - InlineKeyboardButton("⏹ stop stream", callback_data="cbstop"), + InlineKeyboardButton("🔇", callback_data="cbmute"), + InlineKeyboardButton("🔊", callback_data="cbunmute"), ],[ InlineKeyboardButton("🗑 Close", callback_data="cls")], ] From cc7da7e1e6ea73d29503abf2a8ef2866c4b409dd Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:27:51 +0700 Subject: [PATCH 10/13] detailed --- program/admins.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/program/admins.py b/program/admins.py index e83e8a2..cb05327 100644 --- a/program/admins.py +++ b/program/admins.py @@ -180,13 +180,13 @@ async def unmute(client, m: Message): async def cbpause(_, 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 !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") chat_id = query.message.chat.id if chat_id in QUEUE: try: await call_py.pause_stream(chat_id) await query.edit_message_text( - "⏸ streaming is paused", reply_markup=bttn + "⏸ streaming has paused", reply_markup=bttn ) except Exception as e: await query.edit_message_text(f"🚫 **error:**\n\n`{e}`", reply_markup=bcl) @@ -198,13 +198,13 @@ async def cbpause(_, query: CallbackQuery): async def cbresume(_, 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 !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") chat_id = query.message.chat.id if chat_id in QUEUE: try: await call_py.resume_stream(chat_id) await query.edit_message_text( - "▶️ streaming is resumed", reply_markup=bttn + "▶️ streaming has resumed", reply_markup=bttn ) except Exception as e: await query.edit_message_text(f"🚫 **error:**\n\n`{e}`", reply_markup=bcl) @@ -216,7 +216,7 @@ async def cbresume(_, query: CallbackQuery): async def cbstop(_, 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 !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -233,7 +233,7 @@ async def cbstop(_, query: CallbackQuery): async def cbmute(_, 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 !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -251,7 +251,7 @@ async def cbmute(_, query: CallbackQuery): async def cbunmute(_, 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 !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !") chat_id = query.message.chat.id if chat_id in QUEUE: try: From afe277a7bec1b36f9f9e96c5e1e16322dc1d0c79 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:36:32 +0700 Subject: [PATCH 11/13] forgot --- program/admins.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/program/admins.py b/program/admins.py index cb05327..30cf87c 100644 --- a/program/admins.py +++ b/program/admins.py @@ -180,7 +180,7 @@ async def unmute(client, m: Message): async def cbpause(_, 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 with manage voice chats permission that can tap this button !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -198,7 +198,7 @@ async def cbpause(_, query: CallbackQuery): async def cbresume(_, 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 with manage voice chats permission that can tap this button !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -216,7 +216,7 @@ async def cbresume(_, query: CallbackQuery): async def cbstop(_, 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 with manage voice chats permission that can tap this button !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -233,7 +233,7 @@ async def cbstop(_, query: CallbackQuery): async def cbmute(_, 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 with manage voice chats permission that can tap this button !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) chat_id = query.message.chat.id if chat_id in QUEUE: try: @@ -251,7 +251,7 @@ async def cbmute(_, query: CallbackQuery): async def cbunmute(_, 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 with manage voice chats permission that can tap this button !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) chat_id = query.message.chat.id if chat_id in QUEUE: try: From 4feac7121ff7ac643b006bff72f9a98e66290d28 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 18:25:22 +0700 Subject: [PATCH 12/13] forgot --- program/callback.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program/callback.py b/program/callback.py index e48ac0d..a46d51a 100644 --- a/program/callback.py +++ b/program/callback.py @@ -166,7 +166,7 @@ async def cbsudo(_, 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 with manage voice chats permission that can tap this button !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) await query.edit_message_text( f"⚙️ **settings of** {query.message.chat.title}\n\n**⏸ pause || ▶️ resume**\n**🔇 mute || 🔊 unmute**\n**⏹ stop stream**", reply_markup=InlineKeyboardMarkup( @@ -188,5 +188,5 @@ async def cbmenu(_, 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 with manage voice chats permission that can tap this button !") + return await query.answer("💡 only admin with manage voice chats permission that can tap this button !", show_alert=True) await query.message.delete() From 82cc5ba84bb9a807da73e23092c480d03496bc2b Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Mon, 1 Nov 2021 19:09:36 +0700 Subject: [PATCH 13/13] none --- program/callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/callback.py b/program/callback.py index a46d51a..3375883 100644 --- a/program/callback.py +++ b/program/callback.py @@ -168,7 +168,7 @@ async def cbmenu(_, query: CallbackQuery): 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) await query.edit_message_text( - f"⚙️ **settings of** {query.message.chat.title}\n\n**⏸ pause || ▶️ resume**\n**🔇 mute || 🔊 unmute**\n**⏹ stop stream**", + f"⚙️ **settings of** {query.message.chat.title}\n\n⏸ : pause stream\n▶️ : resume stream\n🔇 : mute userbot\n🔊 : unmute userbot\n⏹ : stop stream", reply_markup=InlineKeyboardMarkup( [[ InlineKeyboardButton("⏹", callback_data="cbstop"),