Skip to content

Commit feab46f

Browse files
committed
Updater: Add botlog when your bot success update
Signed-off-by: MoveAngel <[email protected]>
1 parent df4697d commit feab46f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

userbot/modules/updater.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from git import Repo
1616
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
1717

18-
from userbot import (CMD_HELP, HEROKU_API_KEY, HEROKU_APP_NAME, UPSTREAM_REPO_URL, UPSTREAM_REPO_BRANCH)
18+
from userbot import (BOTLOG, BOTLOG_CHATID, CMD_HELP, HEROKU_API_KEY, HEROKU_APP_NAME, UPSTREAM_REPO_URL, UPSTREAM_REPO_BRANCH)
1919
from userbot.events import register
2020

2121
requirements_path = path.join(
@@ -84,6 +84,12 @@ async def deploy(event, repo, ups_rem, ac_br, txt):
8484
return repo.__del__()
8585
await event.edit('`Successfully Updated!\n'
8686
'Restarting, please wait...`')
87+
88+
if BOTLOG:
89+
await event.client.send_message(
90+
BOTLOG_CHATID, "#UPDATE \n"
91+
"Your One4uBot was successfully updated")
92+
8793
else:
8894
await event.edit('`[HEROKU]:'
8995
'\nPlease set up` **HEROKU_API_KEY** `variable.`'
@@ -99,6 +105,12 @@ async def update(event, repo, ups_rem, ac_br):
99105
await update_requirements()
100106
await event.edit('`Successfully Updated!\n'
101107
'Bot is restarting... Wait for a second!`')
108+
109+
if BOTLOG:
110+
await event.client.send_message(
111+
BOTLOG_CHATID, "#UPDATE \n"
112+
"Your One4uBot was successfully updated")
113+
102114
# Spin a new instance of bot
103115
args = [sys.executable, "-m", "userbot"]
104116
execle(sys.executable, *args, environ)

0 commit comments

Comments
 (0)