try fix this fucking updater

This commit is contained in:
Your Name 2025-01-04 12:23:30 +03:00
parent 16dc60d10d
commit 07c460131c
3 changed files with 9 additions and 2 deletions

View file

@ -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'")

View file

@ -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()

5
updater_helper.sh Executable file
View file

@ -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'