quick fix

This commit is contained in:
dan63047 2020-07-01 21:03:29 +03:00
parent 61ac44f1ee
commit b257d684b6
1 changed files with 8 additions and 2 deletions

View File

@ -723,7 +723,10 @@ def bots():
log(False, f"[NEW_POST] id{event.object.id}")
users = db.get_all_users()
for i in users:
if (config.use_database):
bot[int(i['chat_id'])].event("post", event.object)
else:
bot[int(i)].event("post", event.object)
elif event.type == VkBotEventType.MESSAGE_DENY:
log(False, f"User {event.object.user_id} deny messages from that group")
del bot[int(event.object.user_id)]
@ -742,7 +745,10 @@ def midnight():
log(False, "[EVENT_STARTED] \"Midnight\"")
users = db.get_all_users()
for i in users:
if (config.use_database):
bot[int(i['chat_id'])].event("midnight")
else:
bot[int(i)].event("midnight")
log(False, "[EVENT_ENDED] \"Midnight\"")
time.sleep(1)
else: