From 11e4f9b2dd0856c9f58a520c49d2b8fb50bf8e3051fda17d3ee63d04fe867edc Mon Sep 17 00:00:00 2001 From: andrea Date: Sat, 26 Jul 2025 18:38:40 +0200 Subject: [PATCH] upstart bot --- bot.py | 6 +++--- bot_libs/syms.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 7ca49a0..d21096e 100644 --- a/bot.py +++ b/bot.py @@ -37,10 +37,10 @@ async def update_bot(update, context): chat_id = update.effective_chat.id if update.message.chat.id not in _botsyms.SUPER_USERS: return print(f'update_bot: user {chat_id} not allowed') print(f'update_bot: {chat_id} bot is updating...') - os.system('cd ~/repo/battle_royale_sim; git pull') - os.system('systemctl --user start battle_royale.service') - update.message.reply_text('Bot aggiornato e riavviato!') + _os.system(f'cd {_botsyms.BOT_PATH}; git pull') + _os.system('systemctl --user start battle_royale.service') print(f'update_bot: {chat_id} bot successfully updated') + await update.message.reply_text('Bot aggiornato e riavviato!') async def bot_commands(update, context): text= update.message.text diff --git a/bot_libs/syms.py b/bot_libs/syms.py index 2582d4d..feff504 100644 --- a/bot_libs/syms.py +++ b/bot_libs/syms.py @@ -1,6 +1,10 @@ from local_settings import TOKEN as _token +from local_settings import BOT_PATH as _bot_path +from local_settings import SUPER_USERS as _superusers TOKEN= _token +BOT_PATH= _bot_path +SUPER_USERS= _superusers START_MSG= """Benvenuto nel crudele mondo di Battle Royal Simulator, La tua avventura e quella dei tuoi compagni inizia qui.