Why if else not working inside the if bot telegram?

import telebot


bot = telebot.TeleBot('TOKEN')

day = (["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"])
day_0 = (
 ["10:00 - 10:50\inostranny language,'practice' (teacher-master Suleimenova Zh), K02. Educational building №2, fit, 216",
 "11:00 - 11:50\Mathematica 2,'Lek' (associate Professor Ospanov M. N.), K02. Educational building №2, fit 222",
 "12:10 - 13:00\algoritmi, data structures and programming,'Lek' (Dozent Autora J. J.), K02. Educational building №2, fit, 221"]
)

day_2 = (
 ["8:00 - 8:50\algoritmi, data structures and programming'lab' ( Adilbek A.), K02. Educational building №2, fit 608",
 "9:00 - 9:50\algoritmi, data structures and programming'lab' ( Adilbek A.), K02. Educational building №2, fit 608",
 "10:00 - 10:50\kazahski (Russian) language, 2,'practice' ( Sahin A. A.), K02. Educational building №2, fit 711"]
)

day_3 = (
 ["10:00 - 10:50\Fizicheskaya culture,'practice' (acting Professor Omarov E. B.)",
 "11:00 - 11:50\Fizicheskaya culture,'practice' (acting Professor Omarov E. B.)",
 "12:10 - 13:00\kazahski (Russian) language, 2,'practice' ( Sahin A. A.), K02. Educational building №2, fit 711",
 "13:10 - 14:00\kazahski (Russian) language, 2,'practice' ( Sahin A. A.), K02. Educational building №2, fit 711"]
)

day_4 = (
 ["8:00 - 8:50\informationno communication technologies,'Lek' (senior teacher R. Ospanov M.), K02. Educational building №2, fit, 712",
 "9:00 - 9:50\informationno communication technologies,'Lek' (senior teacher R. Ospanov M.), K02. Educational building №2, fit, 712",
 "10:00 - 10:50\n Window"
 "11:00 - 11:50\informationno communication technology,'practice' ( Khamitova J. J.), К01. Educational building №1, UAK, 352a"]
)

day_5 = (
 ["10:00 - 10:50\Mathematica 2,'practice' (art. Aharanov T. B.), K02. Educational building №2, fit, 707",
 "11:00 - 11:50\Mathematica 2,'practice' (art. Aharanov T. B.), K02. Educational building №2, fit, 707",
 "12:10 - 13:00\inostranny language,'practice' (teacher-master Suleimenova Zh), K02. Educational building №2, fit, 707",
 "13:10 - 14:00\inostranny language,'practice' (teacher-master Suleimenova Zh), K02. Educational building №2, fit, 707"]
)
uni_gr = (["RIGHT-19/1","SIB-23"])

keyboard1 = telebot.types.ReplyKeyboardMarkup(True,True)
keyboard1.row(f"{uni_gr[0]}"f"{uni_gr[1]}")

keyboard2 = telebot.types.ReplyKeyboardMarkup(True,True)
keyboard2.row(f"{day[0]}",f,"{day[1]}"f"{day[2]}")
keyboard2.row(f"{day[3]}"f"{day[4]}",f,"{day[5]}")

@bot.message_handler(commands=['start'])
def start_message(message):
 bot.send_message(message.chat.id 'Which group you need' , reply_markup=keyboard1)


@bot.message_handler(content_types=['text'])
def send_text(message):
 if message.text == f"{uni_gr[0]}":
 bot.send_message(message.chat.id 'Which day you need' , reply_markup=keyboard2)
 def send_shedudle(message):
 if message.text == f"{day[0]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_0[0]}\n\n{day_0[1]}\n\n{day_0[2]}')
 elif message.text == f"{day[1]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\par no, rest')
 elif message.text == f"{day[2]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_2[0]}\n\n{day_2[1]}\n\n{day_2[2]}')
 elif message.text == f"{day[3]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_3[0]}\n\n{day_3[1]}\n\n{day_3[2]}\n \ n{day_3[3]}')
 elif message.text == f"{day[4]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_4[0]}\n\n{day_4[1]}\n\n{day_4[2]}\n \ n{day_4[3]}')
 elif message.text == f"{day[5]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_5[0]}\n\n{day_5[1]}\n\n{day_5[2]}\n\n{day_5[3]}')
 elif message.text == f"{uni_gr[1]}":
 if message.text == f"{day[0]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_0[0]}\n\n{day_0[1]}\n\n{day_0[2]}')
 elif message.text == f"{day[1]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\par no, rest')
 elif message.text == f"{day[2]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_2[0]}\n\n{day_2[1]}\n\n{day_2[2]}')
 elif message.text == f"{day[3]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_3[0]}\n\n{day_3[1]}\n\n{day_3[2]}\n \ n{day_3[3]}')
 elif message.text == f"{day[4]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_4[0]}\n\n{day_4[1]}\n\n{day_4[2]}\n \ n{day_4[3]}')
 elif message.text == f"{day[5]}":
 bot.send_message(message.chat.id f Hello {message.from_user.first_name}\Segodnya:\n\n{day_5[0]}\n\n{day_5[1]}\n\n{day_5[2]}\n\n{day_5[3]}')

if __name__ == '__main__':
 bot.infinity_polling()
April 7th 20 at 10:53
2 answers
April 7th 20 at 10:55
Solution
Why if else not working inside the if bot telegram?

Because it's so impossible. In short: you click to select the group to function send_text coming message.text with group number but after you click to select the day - new message does not come, and the bot checks the if condition message.text == f"{uni_gr[0]}":...

There is a special object bot.register_next_step_handler(message, next_step)

P. S but in General for each group to write the block of conditions is kind of silly, imagine if you want to add another 1-2 of the group is +20 more lines of code. Better to create a database and then all these blocks of conditions can be put in a few lines.

P. P. S I already think that my goal on this site is just to throw people a link to this page
How to add data from the message.text in array telebot?
Can you re-answer this question
Just haven't had time to check
Thank you - Ericka_Mills12 commented on April 7th 20 at 10:58
April 7th 20 at 10:57
Solution
msg = bot.send_message(chatId, "")
bot.register_next_step_handler(msg, send_shedudle)
def send_shedudle(message):

Find more questions by tags PythonBotsTelegram