diff --git a/dan63047bot.py b/dan63047bot.py index e8d5747..3a51dcd 100644 --- a/dan63047bot.py +++ b/dan63047bot.py @@ -723,7 +723,10 @@ def bots(): log(False, f"[NEW_POST] id{event.object.id}") users = db.get_all_users() for i in users: - bot[int(i['chat_id'])].event("post", event.object) + 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: - bot[int(i['chat_id'])].event("midnight") + 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: