Exemplo n.º 1
0
def send_voucher_to_user(update, reward_of_the_day):
    voucher_path = reward_of_the_day[1]
    voucher_info = get_voucher_info(reward_of_the_day)

    caption_to_send = MessageTemplates.gen_voucher_info(voucher_info)

    ReusableComponents.dispatch_voucher(update, voucher_path, caption_to_send)
def inform_exchange_result_to_user(update, user_selected_voucher):
    voucher_info = get_voucher_info(user_selected_voucher)

    caption_to_send = MessageTemplates.gen_voucher_info(voucher_info)

    voucher_path = user_selected_voucher[3]

    ReusableComponents.dispatch_voucher(update, voucher_path, caption_to_send)
def send_confirmation_voucher_to_user(update, user_selected_voucher):
    chosen_voucher_image_path = user_selected_voucher[3]
    voucher_info = get_voucher_info(user_selected_voucher)

    caption_to_send = MessageTemplates.gen_voucher_info(voucher_info, True)

    ReusableComponents.dispatch_voucher(update,
                                        chosen_voucher_image_path,
                                        caption_to_send)

    update.message.reply_text(MessageTemplates.confirm_claim_message)
def send_vouchers_to_user(update, vouchers_in_promo_code):
    for voucher_info in vouchers_in_promo_code:
        voucher_path = voucher_info[3]

        voucher_info_to_send = get_voucher_info(voucher_info)

        caption_to_send = MessageTemplates.gen_voucher_info(
            voucher_info_to_send)

        ReusableComponents.dispatch_voucher(update, voucher_path,
                                            caption_to_send)