updater
This commit is contained in:
6
main.py
6
main.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user