def start(account_id, _, __, ___):
    """
    Handle the user start using robots.
    Send the robot's self introduction information,
    and the chat room is bound with rich menu.

    :param account_id: user account id.
    """
    contents = yield start_content(account_id)

    yield push_messages(account_id, contents)
def direct_sign_out(account_id, current_date, sign_time, _):
    """
    Handle the user's direct check-out.

    :param account_id: user account id.
    :param current_date: current date by local time.
    :param sign_time: Time when the user clicks to check-out.
    :param _: no use
    """
    content, _ = yield deal_sign_out(account_id, current_date, sign_time)

    yield push_messages(account_id, content)
Example #3
0
def manual_sign_out(account_id, current_date, _, __):
    """
    Handle the user's manual check-out.

    :param account_id: user account id.
    :param current_date: current date by local time.
    :param _: no use
    :param __: no use
    """
    contents = yield manual_sign_out_content(account_id, current_date)

    yield push_messages(account_id, contents)
def deal_message(account_id, current_date, create_time, message):
    """
    Process messages manually entered by the user.

    :param account_id: user account id.
    :param current_date: current date by local time.
    :param create_time: Time the request arrived at the server.
    :param callback: User triggered callback.
    :return: None
    """

    contents = yield deal_user_message(account_id, current_date, create_time,
                                       message)

    yield push_messages(account_id, contents)
def confirm_out(account_id, current_date, create_time, callback):
    """
    This function is triggered when the user clicks confirm check-out.
    will be linked with the calendar internally.

    :param account_id: user account id.
    :param current_date: current date by local time.
    :param create_time: Time the request arrived at the server.
    :param callback: User triggered callback.
    :return: None
    """
    contents = yield deal_confirm_out(account_id, create_time, callback)

    set_status_by_user_date(account_id, current_date,
                            status="out_done", process="sign_out_done")
    yield push_messages(account_id, contents)