Add Heroku shutdown

This commit is contained in:
Juan 2021-09-10 08:38:29 +07:00 committed by GitHub
parent 590b4edd0c
commit 3f60e1975a
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,11 @@ from bot.helper import check_heroku
@app.on_message(filters.command(['reboot', f'reboot@{bot.username}']) & filters.user(OWNER_ID))
@check_heroku
async def gib_restart(client, message, hap):
msg_ = await message.reply_text("[HEROKU] - Restarting")
msg_ = await message.reply_text("**[HEROKU] - Restarting**")
hap.restart()
@app.on_message(filters.command(['shutdown', f'shutdown@{bot.username}']) & filters.user(OWNER_ID))
@check_heroku
async def shutdown(client, message, app_):
msg_ = await message.reply_text("**[HEROKU] - Shutdown**\n\n**NOTE: You need to turn on manual from Heroku to use this bot again.**")
app_.process_formation()["worker"].scale(0)