Spaces:
Paused
Paused
| from pyrogram import filters | |
| from pyrogram.types import Message | |
| from DragMusic import app | |
| from DragMusic.misc import SUDOERS | |
| from DragMusic.utils.database import autoend_off, autoend_on | |
| async def auto_end_stream(_, message: Message): | |
| usage = "<b>ᴇxᴀᴍᴘʟᴇ :</b>\n\n/autoend [ᴇɴᴀʙʟᴇ | ᴅɪsᴀʙʟᴇ]" | |
| if len(message.command) != 2: | |
| return await message.reply_text(usage) | |
| state = message.text.split(None, 1)[1].strip().lower() | |
| if state == "enable": | |
| await autoend_on() | |
| await message.reply_text( | |
| "» ᴀᴜᴛᴏ ᴇɴᴅ sᴛʀᴇᴀᴍ ᴇɴᴀʙʟᴇᴅ.\n\nᴀssɪsᴛᴀɴᴛ ᴡɪʟʟ ᴀᴜᴛᴏᴍᴀᴛɪᴄᴀʟʟʏ ʟᴇᴀᴠᴇ ᴛʜᴇ ᴠɪᴅᴇᴏᴄʜᴀᴛ ᴀғᴛᴇʀ ғᴇᴡ ᴍɪɴs ᴡʜᴇɴ ɴᴏ ᴏɴᴇ ɪs ʟɪsᴛᴇɴɪɴɢ." | |
| ) | |
| elif state == "disable": | |
| await autoend_off() | |
| await message.reply_text("» ᴀᴜᴛᴏ ᴇɴᴅ sᴛʀᴇᴀᴍ ᴅɪsᴀʙʟᴇᴅ.") | |
| else: | |
| await message.reply_text(usage) | |