Python
8
Вклад в тег
import schedule
import time
import threading
def job():
print("I'm working...")
schedule.every(1).minutes.do(job)
def go():
while 1:
schedule.run_pending()
time.sleep(1)
t = threading.Thread(target=go, name="тест")
t.start()
@bot.message_handler(commands=['info'])
def handle_text(message):
answer = 'БЛА-БЛА-БЛА.'
bot.send_message(message.chat.id, answer)
if __name__ == '__main__':
bot.polling(none_stop=True, interval=0)
import fsm_telebot
from fsm_telebot.storage.memory import MemoryStorage
storage = MemoryStorage()
bot.set_state('level_1', message.chat.id)
@bot.message_handler(state='level_1')