diff --git a/src/updatenotif.py b/src/updatenotif.py index c9a0f53..e111f77 100644 --- a/src/updatenotif.py +++ b/src/updatenotif.py @@ -20,7 +20,7 @@ async def git_notifications_update(): logger.info('updates not found, nothing to do') else: os.system( - f"cat upd_info | termux-notification -i ub4tgupd --title 'ub4tg: update avalaible!' --button1 'Get update' --button1-action 'termux-notification-remove ub4tgupd; cd {cwd}; git pull; termux-toast 'ub4tg updated, now restart it for apply update''") + f"cat upd_info | termux-notification -i ub4tgupd --title 'ub4tg: update avalaible!' --button1 'Get update' --button1-action {cwd}/updater_helper.sh") else: os.system( "termux-toast '[ub4tg]: failed fetching update, maybe connection error, check console log for more info'") diff --git a/ubot.py b/ubot.py index 83e64a0..a606884 100644 --- a/ubot.py +++ b/ubot.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from s import is_termux, sessdb, default_directory, config +from s import is_termux, termux_api, sessdb, default_directory, config from src import autobioebbing, avocmine, victimsbackup, updatenotif, stat # from telethon.sync import TelegramClient @@ -228,6 +228,8 @@ Commands for ub4tg await asyncio.sleep(1) await event.edit(help_message) + if termux_api: + os.system("termux-toast -b black -c green 'bot started'") await client.run_until_disconnected() diff --git a/updater_helper.sh b/updater_helper.sh new file mode 100755 index 0000000..f87a98f --- /dev/null +++ b/updater_helper.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +termux-notification-remove ub4tgupd +cd $1 +git pull && termux-toast -b black -c green 'ub4tg updated, now restart it for apply update' || termux-toast -b black -c red 'ub4tg update failed'