mirror of
https://github.com/anonymousx97/social-dl.git
synced 2025-02-20 11:13:19 +08:00
What's New: - Sort Plugins into their respective folders. - download, upload, rename commands. - Help Docstrings. - Proper Logging. - rename .exec cmd to .py
22 lines
639 B
Python
22 lines
639 B
Python
import os
|
|
|
|
from pyrogram.enums import ChatType
|
|
|
|
from app import BOT, Message, bot
|
|
|
|
|
|
@bot.add_cmd(cmd="restart")
|
|
async def restart(bot: BOT, message: Message, u_resp: Message | None = None) -> None:
|
|
"""
|
|
CMD: RESTART
|
|
INFO: Restart the Bot.
|
|
FLAGS: -h for hard restart and clearing logs
|
|
Usage:
|
|
.restart | .restart -h
|
|
"""
|
|
reply: Message = u_resp or await message.reply("restarting....")
|
|
if reply.chat.type in (ChatType.GROUP, ChatType.SUPERGROUP):
|
|
os.environ["RESTART_MSG"] = str(reply.id)
|
|
os.environ["RESTART_CHAT"] = str(reply.chat.id)
|
|
await bot.restart(hard="-h" in message.flags)
|