This commit is contained in:
2024-03-07 19:58:02 +03:00
parent b6c0be0d00
commit 7c730cd831
4 changed files with 61 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
import datetime
import os
import sys
from random import randrange, choice
@@ -68,6 +69,8 @@ def do_action(message: Message):
bot.reply_to(message, choice(get_replies()))
return
info = get_chat_info(message.chat.id)
if client.get_config('updater')['enabled']:
set_values(message.chat.id, last_time_updated=datetime.datetime.now())
if message.text == '#debug' and client.is_staff(telegram_id=message.from_user.id):
bot.send_message(message.chat.id, f'chat id: {message.chat.id}\n'
f'probability: {info["probability"]}')
@@ -97,6 +100,9 @@ def do_action(message: Message):
arg = sys.argv[-1]
if arg == 'bot':
bot.polling()
elif arg == 'updater':
from updater import update
update()
else:
from api import app
app.run(host="0.0.0.0", port=1238)