def authorization(message): if message.text == "Переподаватель": bot.register_next_step_handler( bot.send_message(message.chat.id, 'Введите пароль'), check_pass) if message.text == "Студент": users.append(message.chat.id) start_user(message)
def get_patronymic(message): l = new_students.get(message.chat.id) l.append(message.text) new_students.update({message.chat.id: l}) bot.register_next_step_handler( bot.send_message(message.chat.id, "Введите номер зачетки"), get_record_book)
def handle_start(message): if admins.count(message) == 0 and users.count(message) == 0: users.append(message.chat.id) bot.register_next_step_handler(keyboard_start(message), authorization) if admins.count(message) != 0: start_admin(message) if users.count(message) != 0: start_user(message)
def check_pass(message): if message.text == password: users.remove(message.chat.id) bot.send_message(message.chat.id, "Вы авторизовались как преподаватель") admins.append(message.chat.id) start_admin(message) else: bot.send_message(message.chat.id, "Неправильный пароль") bot.register_next_step_handler(keyboard_start(message), authorization)
def start_admin(message): bot.register_next_step_handler(keyboard_admin(message), menu)
def handle_reset(message): if users.count(message) != 0: start_user(message) if admins.count(message) != 0: start_admin(message) bot.register_next_step_handler(keyboard_start(message), authorization)
def get_name(message): l = new_students.get(message.chat.id) l.append(message.text) new_students.update({message.chat.id: l}) bot.register_next_step_handler( bot.send_message(message.chat.id, "Введите очество"), get_patronymic)
def get_surname(message): l = [] l.append(message.text) new_students.update({message.chat.id: l}) bot.register_next_step_handler( bot.send_message(message.chat.id, "Введите имя"), get_name)
def sign_on_course(message): bot.register_next_step_handler( bot.send_message(message.chat.id, "Введите Фамилию"), get_surname)