Reboot does not require kill anymore
This commit is contained in:
parent
ed748f70d3
commit
199f470192
@ -1,7 +1,9 @@
|
|||||||
from app import app, isAnAdmin
|
from app import app, isAnAdmin
|
||||||
from os import getpid
|
from os import getpid
|
||||||
|
from sys import exit
|
||||||
from pyrogram import filters
|
from pyrogram import filters
|
||||||
from modules.utils import configGet, logWrite, killProc, should_quote
|
from modules.utils import configGet, logWrite, should_quote
|
||||||
|
from modules.scheduled import scheduler
|
||||||
|
|
||||||
pid = getpid()
|
pid = getpid()
|
||||||
|
|
||||||
@ -12,5 +14,6 @@ async def cmd_kill(app, msg):
|
|||||||
if msg.chat.id == configGet("admin_group") or await isAnAdmin(msg.from_user.id):
|
if msg.chat.id == configGet("admin_group") or await isAnAdmin(msg.from_user.id):
|
||||||
logWrite(f"Shutting down bot with pid {pid}")
|
logWrite(f"Shutting down bot with pid {pid}")
|
||||||
await msg.reply_text(f"Вимкнення бота з підом `{pid}`", quote=should_quote(msg))
|
await msg.reply_text(f"Вимкнення бота з підом `{pid}`", quote=should_quote(msg))
|
||||||
killProc(pid)
|
scheduler.shutdown()
|
||||||
|
exit()
|
||||||
# ==============================================================================================================================
|
# ==============================================================================================================================
|
Reference in New Issue
Block a user