File size: 1,101 Bytes
a8e9b84 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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
@app.on_message(filters.command("autoend") & SUDOERS)
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)
|