I have these 2 functions, by the end of each bot will send random message from txt file. For example i want to schedule 1 func at 9 AM, and second at 10 PM. But module schedule
doesn't work and idk why.
@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)
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)
So i've gone through all the docs but coldn't find the answer to my question