@bot.message_handler(content_types=['int', 'text'])
def work(message):
if message.text == '1 курс':
for y in x:
if y.replace("\n", "") == time.strftime("%d %b", time.localtime(message.date)):
for y1 in x:
if y1 != '_\n':
bot.send_message(message.chat.id, y1)
time.sleep(1)
elif y1 == '_\n':
bot.stop_polling()