def call_main_menu(call): msg = Message(1) msg.menu(call.message.chat.username) keyboard = Markup() keyboard.start() bot.send_message(call.message.chat.id, msg.text, reply_markup=keyboard.keyboard)
def call_body_new(call): id_ = call.message.chat.id user = User(id_) user.state_movie = 1 msg = Message(1) msg.main_() keyboard = Markup() keyboard.select() bot.send_photo(user.id_, msg.image, msg.text, parse_mode='HTML', reply_markup=keyboard.keyboard)
def start(message): is_exist = start(message.chat.id) msg = Message(1) msg.menu(message.chat.username) keyboard = Markup() keyboard.start() if is_exist: pass else: bot.send_message(message.chat.id, 'Добро пожаловать') bot.send_message(message.chat.id, msg.text, reply_markup=keyboard.keyboard)
def call_session(call): id_ = call.message.chat.id msg_id = call.message.json['message_id'] user = User(id_) msg = Message(user.state_movie) msg.session(int(call.data) - 1) keyboard = Markup() keyboard.back() bot.edit_message_media(chat_id=id_, message_id=msg_id, media=types.InputMediaPhoto(msg.image, caption=msg.text, parse_mode='HTML'), reply_markup=keyboard.keyboard)
def call_body_cinema(call): id_ = call.message.chat.id msg_id = call.message.json['message_id'] user = User(id_) msg = Message(user.state_movie) msg.cinemas() keyboard = Markup() keyboard.cinemas(msg.total_cinemas) bot.edit_message_media(chat_id=id_, message_id=msg_id, media=types.InputMediaPhoto(msg.image, caption=msg.text, parse_mode='HTML'), reply_markup=keyboard.keyboard)
def call_body_next(call): id_ = call.message.chat.id msg_id = call.message.json['message_id'] user = User(id_) # -------------------------------------- if call.data == 'next': user.next_movie() elif call.data == 'previous': user.previous_movie() elif call.data == 'now': pass else: assert "Этого не должно произойти, но может.\n Обрабатываем кнопку Далее и Назад" # -------------------------------------- msg = Message(user.state_movie) msg.main_() keyboard = Markup() keyboard.select() bot.edit_message_media(chat_id=id_, message_id=msg_id, media=types.InputMediaPhoto(msg.image, caption=msg.text, parse_mode='HTML'), reply_markup=keyboard.keyboard)