Understood

This commit is contained in:
Egor Guslyancev 2023-12-10 15:46:14 -03:00
parent 5bfca501d0
commit 3ca4404c77
GPG Key ID: D7E709AA465A55F9
2 changed files with 7 additions and 7 deletions

10
bot.py
View File

@ -354,7 +354,7 @@ if __debug__:
if chat is not None:
bot.delete_message(forum, message.id)
if message.from_user.username == read_db("about.host"):
pretty(db)
pretty(get_db())
@bot.message_handler(commands=['exec'])
def exec_bot(message):
@ -1204,7 +1204,7 @@ def process2():
if cur_time - prev_time >= period:
prev_time = cur_time
stdout.write("Update\n")
for i in db.keys():
for i in get_db().keys():
try:
update(int(i))
except ValueError:
@ -1216,13 +1216,9 @@ for i in threads:
i.daemon = True
i.start()
print(version, cur_version, version != cur_version)
if version != cur_version:
print(db.keys())
for i in db.keys():
print(i)
for i in get_db().keys():
try:
print("Notify", i)
update_notify(int(i))
print("Notified", i)
except ValueError:

View File

@ -9,6 +9,10 @@ from sys import stderr, stdout, stdin
db = {}
def get_db():
global db
return db
def save_db(dbfo = ".db"):
global db
try: