def send(account_id, __, ___): """ This function processes the content of the user confirmation message :param account_id: user account. """ status, __, type, message = get_user_status(account_id) if status != "done" or message is None: # todo add error prompt raise HTTPError(500, "user status error. status error") content = make_text( "Your question has been sent to the person in charge. \n\n" "The staff will answer your question as soon as possible.") content1 = make_text("If you have any additional questions, " "please select the task from below. " "If you want to go back to the initial stage, " "select [Go to Initial Menu] from the menu below.") content1["quickReply"] = create_quick_replay() title = "{type} inquiry details".format(type=type) prompt_message = yield create_articles(title, message, account_id) if prompt_message is not None: yield push_messages(account_id, [prompt_message]) return clean_user_status(account_id) yield push_messages(account_id, [content, content1])
def enquire(account_id, __, ___): """ This function handles the user's selection of ask a person :param account_id: user account id. """ content = make_text("Select a task related to your question.") content["quickReply"] = create_quick_replay() yield push_message(account_id, content)
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)
def send(account_id, __, ___): """ This function processes the content of the user confirmation message :param account_id: user account. """ status, __, type, message = get_user_status(account_id) if status != "done" or message is None: # todo add error prompt raise HTTPError(500, "user status error. status error") fmt = _("Your question has been sent to the person in charge. \n\n" "The staff will answer your question as soon as possible.") content = make_i18n_text( "Your question has been sent to the person in charge. \n\n" "The staff will answer your question as soon as possible.", "send", fmt) fmt = _("If you have any additional questions, " "please select the task from below. " "If you want to go back to the initial stage, " "select [Go to Initial Menu] from the menu below.") content1 = make_i18n_text( "If you have any additional questions, " "please select the task from below. " "If you want to go back to the initial stage, " "select [Go to Initial Menu] from the menu below.", "send", fmt) content1["quickReply"] = create_quick_replay() name, department = yield get_account_info(account_id) fmt = _("{department} {name} made an inquiry.") title = get_i18n_content_by_lang(fmt, "send", DEFAULT_LANG, department=department, name=name) prompt_message = yield create_articles(title, type, message, account_id) if prompt_message is not None: yield push_messages(account_id, [prompt_message]) return clean_user_status(account_id) yield push_messages(account_id, [content, content1])