Understood
This commit is contained in:
parent
5bfca501d0
commit
3ca4404c77
10
bot.py
10
bot.py
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue