ONesVC_bot / YukkiMusic /plugins /sudo /videolimit.py
BinaryONe
Refresh Update
2f67506
#
# Copyright (C) 2021-2022 by TeamYukki@Github, < https://github.com/TeamYukki >.
#
# This file is part of < https://github.com/TeamYukki/YukkiMusicBot > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/TeamYukki/YukkiMusicBot/blob/master/LICENSE >
#
# All rights reserved.
from pyrogram import filters
from pyrogram.types import Message
from strings import get_command
from YukkiMusic import app
from YukkiMusic.misc import SUDOERS
from YukkiMusic.utils.database import set_video_limit
from YukkiMusic.utils.decorators.language import language
VIDEOLIMIT_COMMAND = get_command("VIDEOLIMIT_COMMAND")
@app.on_message(filters.command(VIDEOLIMIT_COMMAND) & SUDOERS)
@language
async def set_video_limit_kid(client, message: Message, _):
if len(message.command) != 2:
usage = _["vid_1"]
return await message.reply_text(usage)
message.chat.id
state = message.text.split(None, 1)[1].strip()
if state.lower() == "disable":
limit = 0
await set_video_limit(limit)
return await message.reply_text(_["vid_4"])
if state.isnumeric():
limit = int(state)
await set_video_limit(limit)
if limit == 0:
return await message.reply_text(_["vid_4"])
await message.reply_text(_["vid_3"].format(limit))
else:
return await message.reply_text(_["vid_2"])