def handle_add_photos(message, request, id_obj_map): print("PHOTOS") user_types = get_inline_buttons(['Add photos', 'Skip']) data = {"chat_id": message.get_id(), "reply_markup": user_types} # Do you want to add some photos? send_post_message(data.get('chat_id'), 'Do you want to add some photosβ π·', data)
def handle_exciting_receiver_in_db(message, request, id_obj_map): user_types = get_inline_buttons(['Show food', 'Restart Process']) data = {"chat_id": message.get_id(), "reply_markup": user_types} # what would you like to do? send_post_message( data.get('chat_id'), 'Ok, I see that you have been here before π\nWhat would you like to do?', data)
def handle_add_receiver_process_end(message): show_db = get_inline_buttons(['Show food', 'skip']) data = {"chat_id": message.get_id(), "reply_markup": show_db} send_post_message( data.get('chat_id'), "Thank you for your cooperation π, I have saved all your information π\nWhat's nextβ", data)
def handle_experation_day(message, request, id_obj_map): print("in experation day") servings_options = get_inline_buttons(experation_day_options) print("created buttons") data = {"chat_id": message.get_id(), "reply_markup": servings_options} print("going to send") # send_post_message(data.get('chat_id'), 'The food is good for? ββ', data) print("sent")
def handle_receiver_food_types(message, id_obj_map): print("HANDLE FOOD for reciever") food_type_options = [ 'Halal', 'Kosher', 'Vegetarian', 'Vegan', 'Animals', 'Other', 'Done' ] reciverId = message.get_id() sign_list_2 = [('β' if (food_type in id_obj_map[reciverId].food_types) else '-') for food_type in food_type_options] servings_options = get_poll_buttons(food_type_options, sign_list_2) data = {"chat_id": message.get_id(), "reply_markup": servings_options} print("ended handling food for reciever") send_post_message( data.get('chat_id'), 'Ok, let me know more about your food preferences π π π₯ ββ', data)
def handle_food_types(message, id_obj_map): food_type_options = [ 'Halal', 'Kosher', 'Vegetarian', 'Vegan', 'Animals', 'Other', 'Done' ] print("HANDLE FOOD type for a specific meal") DonatorId = message.get_id() currentMeal = id_obj_map[DonatorId].m_food_being_built sign_list_2 = [('β' if (food_type in currentMeal.m_food_types) else '-') for food_type in food_type_options] print("after adding") print(sign_list_2) print("created buttons") servings_options = get_poll_buttons(food_type_options, sign_list_2) print("created buttons") data = {"chat_id": message.get_id(), "reply_markup": servings_options} send_post_message( data.get('chat_id'), 'Ok, let me know more about your food preferences π π π₯ β', data)
def handle_location(message, request, id_obj_map): location_button = get_keyboard_buttons(['Share My Location']) data = {"chat_id": message.get_id(), "reply_markup": location_button} # Please send your location send_post_message(data.get('chat_id'), 'Please send me your location πΊ', data)
def handle_choosing_user_type(message, request, id_obj_map): print("HERE") user_types = get_inline_buttons(['Donator', 'Receiver']) data = {"chat_id": message.get_id(), "reply_markup": user_types} send_post_message(data.get('chat_id'), 'Are you a Donator or Receiver? π§', data)
def handle_num_of_servings(message, request, id_obj_map): print("we are in number of servings") servings_options = get_inline_buttons(serving_size_options) data = {"chat_id": message.get_id(), "reply_markup": servings_options} send_post_message(data.get('chat_id'), 'Ok, how many people is the meal for? π€', data)