Python Telebot API function starting

42 Views Asked by At

So I got this function, which works only if the user sends any message to the bot. Can I change something for it to start just after previous function sends us here?

    <...>
    bot.register_next_step_handler(text_from_creator, receiving_text_from_creator)


def receiving_text_from_creator(message):
    while True:
        cursor.execute('SELECT * FROM Exchanges WHERE id = ? AND text_creator != "-"',
                       (id_to_check,))
        rows = cursor.fetchone()
        send_to_opener = rows[1]
        print(rows)
        if rows is not None:
            bot.send_message(message.chat.id, str(send_to_opener))
            return
        time.sleep(1)
 
0

There are 0 best solutions below