Exemplo n.º 1
0
def transfer_message(account_id, callback, __):
    """
    This function prompts the user to go to ask someone.

    :param account_id: user account id.
    :param callback: Business type.
    """
    fmt = _("Your question will be directly delivered to the person "
            "in charge of {type} to answer your question directly.")
    content1 = make_i18n_text(
        "Your question will be directly delivered to "
        "the person in charge of {type} "
        "to answer your question directly.".format(type=TYPES[callback]),
        "transfer_message",
        fmt,
        type=callback)

    fmt1 = _(
        "Please tell me your question.\n\nOnly one message can be delivered. "
        "Please write your question at one go.")
    content2 = make_i18n_text(
        "Please tell me your question.\n\n"
        "Only one message can be delivered. "
        "Please write your question at one go.", "transfer_message", fmt1)

    yield asyncio.sleep(0.5)
    set_replace_user_info(account_id, 'wait_in', 'doing', callback)

    yield push_messages(account_id, [content1, content2])
Exemplo n.º 2
0
def enquire_message(account_id, callback, __):
    """
    This function prompts the user for a message.

    :param account_id: user account id.
    :param callback: Callback corresponding to business type.
    """

    fmt = _("You have selected {type}. Please tell me your question.")
    content1 = make_i18n_text(
        "You have selected {type}. "
        "Please tell me your question.".format(type=TYPES[callback]),
        "enquire_message",
        fmt,
        type=callback)

    fmt = _("Only one message can be delivered. "
            "Please write your question at one go.")
    content2 = make_i18n_text(
        "Only one message can be delivered. "
        "Please write your question at one go.", "enquire_message", fmt)

    yield asyncio.sleep(0.5)

    set_replace_user_info(account_id, 'wait_in', 'doing', callback)

    yield push_messages(account_id, [content1, content2])
Exemplo n.º 3
0
def enquire(account_id, __, ___):
    """
    This function handles the user's selection of ask a person

    :param account_id: user account id.
    """
    set_replace_user_info(account_id, "none", "doing", "none")
    fmt = _("Select a task related to your question.")
    content = make_i18n_text("Select a task related to your question.",
                             "enquire", fmt)

    content["quickReply"] = create_quick_replay()

    yield push_message(account_id, content)
Exemplo n.º 4
0
def query(account_id, __, ___):
    """
    This Function to deal "find FAQ" by task.
    :param account_id: user account id.
    """
    set_replace_user_info(account_id, "none", "doing", "none")
    fmt = _("Please select an work-related item that you would like to know.")
    content1 = make_i18n_text(
        "Please select an work-related item "
        "that you would like to know.", "query", fmt)

    content2 = template_introduce()

    yield push_messages(account_id, [content1, content2])