Как запланировать эти 2 функции
У меня есть 2 функции, по итогу которых отправляется рандомное сообщение из текстового файла. Хочу запланировать 1 функцию на 9 утра, 2 функцию на 10 вечера. Но модуль schedule почему-то не срабатывает. Перерыл всю документацию не могу найти ответ
@bot.message_handler(commands=['start'])
def foo(message):
keyboard = types.InlineKeyboardMarkup()
url_button = types.InlineKeyboardButton(text="Перейти на опрос",
url="https://docs.google.com/forms/d/e/")
keyboard.add(url_button)
bot.send_message(message.chat.id, "Привет! Нажми на кнопку и перейди в опрос.",
reply_markup=keyboard)
lines = open("test.txt", encoding="utf8").read().splitlines()
randomLine1 = random.choice(lines)
bot.send_message(message.chat.id, text=randomLine1)
print(randomLine1)
@bot.message_handler(func=lambda call:True)
def doo(message):
keyboard = types.InlineKeyboardMarkup()
url_button = types.InlineKeyboardButton(text="Перейти на опрос2",
url="https://docs.google.com/forms/d/e/")
keyboard.add(url_button)
bot.send_message(message.chat.id, "Привет! Нажми на кнопку и перейди в опрос.2",
reply_markup=keyboard)
lines = open("test.txt", encoding="utf8").read().splitlines()
randomLine2 = random.choice(lines)
bot.send_message(message.chat.id, text=randomLine2)