Подскажите пожалуйста каким образом исправить на рабочий. Заранее огромное спасибо
list_of_groups = [] a = [] text = [] connection = sqlite3.connect("stats.db") cursor = connection.cursor() try: cursor.execute('''CREATE TABLE chats( id INTEGER, time TEXT text TEXT) ''') connection.commit() except: pass @app.on_message(filters.command("time", prefixes="/") & filters.me) async def time(_, msg: Message): global text global connection global list_of_groups global cursor check = cursor.execute("SELECT id, time, text FROM chats").fetchall() done_list = str(check).replace(", '", "/").replace("(", "").replace(")", "").replace(",", "").replace("'", "").replace( "[", "").replace("]", "").split() list_of_groups = done_list start, end = map(str, msg.text.replace("/time ", "").split()) now = datetime.datetime.now() used = [] while True: now = datetime.datetime.now() if str(now)[11:16] == start: for group in list_of_groups: nud, interval, text = map(str, group.replace("/", " ").split()) try: await app.send_message(chat_id=int(nud), text=text) except: pass break await sleep(60)