diff --git a/program/admins.py b/program/admins.py index 7759cee..1909654 100644 --- a/program/admins.py +++ b/program/admins.py @@ -1,11 +1,11 @@ from cache.admins import admins -from config import BOT_USERNAME, GROUP_SUPPORT, IMG_3, UPDATES_CHANNEL +from driver.veez import call_py +from pyrogram import Client, filters from driver.decorators import authorized_users_only from driver.filters import command, other_filters from driver.queues import QUEUE, clear_queue from driver.utils import skip_current_song, skip_item -from driver.veez import call_py -from pyrogram import Client +from config import BOT_USERNAME, GROUP_SUPPORT, IMG_3, UPDATES_CHANNEL from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message @@ -125,6 +125,42 @@ async def resume(client, m: Message): await m.reply("โŒ **nothing in streaming**") +@Client.on_message( + command(["mute", f"mute@{BOT_USERNAME}", "vmute"]) & other_filters +) +@authorized_users_only +async def mute(client, m: Message): + chat_id = m.chat.id + if chat_id in QUEUE: + try: + await call_py.mute_stream(chat_id) + await m.reply( + "๐Ÿ”‡ **Userbot muted.**\n\nโ€ข **To unmute the userbot, use the**\nยป /unmute command." + ) + except Exception as e: + await m.reply(f"๐Ÿšซ **error:**\n\n`{e}`") + else: + await m.reply("โŒ **nothing in streaming**") + + +@Client.on_message( + command(["unmute", f"unmute@{BOT_USERNAME}", "vunmute"]) & other_filters +) +@authorized_users_only +async def unmute(client, m: Message): + chat_id = m.chat.id + if chat_id in QUEUE: + try: + await call_py.unmute_stream(chat_id) + await m.reply( + "๐Ÿ”Š **Userbot unmuted.**\n\nโ€ข **To mute the userbot, use the**\nยป /mute command." + ) + except Exception as e: + await m.reply(f"๐Ÿšซ **error:**\n\n`{e}`") + else: + await m.reply("โŒ **nothing in streaming**") + + @Client.on_message( command(["volume", f"volume@{BOT_USERNAME}", "vol"]) & other_filters )