upstart bot
This commit is contained in:
6
bot.py
6
bot.py
@@ -37,10 +37,10 @@ async def update_bot(update, context):
|
|||||||
chat_id = update.effective_chat.id
|
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')
|
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...')
|
print(f'update_bot: {chat_id} bot is updating...')
|
||||||
os.system('cd ~/repo/battle_royale_sim; git pull')
|
_os.system(f'cd {_botsyms.BOT_PATH}; git pull')
|
||||||
os.system('systemctl --user start battle_royale.service')
|
_os.system('systemctl --user start battle_royale.service')
|
||||||
update.message.reply_text('Bot aggiornato e riavviato!')
|
|
||||||
print(f'update_bot: {chat_id} bot successfully updated')
|
print(f'update_bot: {chat_id} bot successfully updated')
|
||||||
|
await update.message.reply_text('Bot aggiornato e riavviato!')
|
||||||
|
|
||||||
async def bot_commands(update, context):
|
async def bot_commands(update, context):
|
||||||
text= update.message.text
|
text= update.message.text
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
from local_settings import TOKEN as _token
|
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
|
TOKEN= _token
|
||||||
|
BOT_PATH= _bot_path
|
||||||
|
SUPER_USERS= _superusers
|
||||||
|
|
||||||
START_MSG= """Benvenuto nel crudele mondo di Battle Royal Simulator,
|
START_MSG= """Benvenuto nel crudele mondo di Battle Royal Simulator,
|
||||||
La tua avventura e quella dei tuoi compagni inizia qui.
|
La tua avventura e quella dei tuoi compagni inizia qui.
|
||||||
|
|||||||
Reference in New Issue
Block a user