how to work with simultaneity with telegram bot python

Viewed 8981

I dont know how to do multiprocess with bot in telegram with python. I make one thread but if this thread dont finish the bot cant answer messages.

horaPurga= now.replace(hour=23, minute=36,second=59,microsecond=0)

def purga(threading.Thread):
    now = datetime.now()

    if now >= horaPurga :
        bot.send_message(cid, 'pole')

def run():
    while True:
        purga.start()
        time.sleep(2)
1 Answers
Related