68 lines
2.1 KiB
Python
68 lines
2.1 KiB
Python
Saturn mode is not enabled
|
|
|
|
Assistant class definition:
|
|
display_message(message):
|
|
If Saturn mode is enabled:
|
|
Print "🪐: " + concise_response(message) # Display concise response in Saturn mode
|
|
If Saturn mode is disabled:
|
|
Print "💬: " + response(message) # Display regular response for all messages not in Saturn mode
|
|
|
|
status_message(message):
|
|
Print "#: " + message
|
|
|
|
reply(message):
|
|
Call display_message(message)
|
|
|
|
Create an instance of Assistant called assistant
|
|
|
|
# Toggle Saturn mode on/off
|
|
define toggle_saturn_mode:
|
|
If Saturn mode is enabled:
|
|
Disable Saturn mode
|
|
Set mode_status to "disabled"
|
|
Else:
|
|
Enable Saturn mode
|
|
Set mode_status to "enabled"
|
|
Call status_message("Saturn mode is now " + mode_status)
|
|
|
|
# Check if Saturn mode is enabled or disabled
|
|
define check_saturn_mode_status:
|
|
If Saturn mode is enabled:
|
|
Set mode_status to "enabled"
|
|
Else:
|
|
Set mode_status to "disabled"
|
|
Call status_message("Saturn mode is currently " + mode_status)
|
|
|
|
# Handle user actions with optional prefix
|
|
define handle_action with action:
|
|
If Saturn mode is enabled:
|
|
Set prefix to "/me "
|
|
Else:
|
|
Set prefix to nothing
|
|
Print prefix + action
|
|
|
|
# Display help information
|
|
display_help_information:
|
|
Set help_message to a multi-line string explaining available commands
|
|
Call display_message(help_message)
|
|
|
|
|
|
# All input recieved should be handles by this function
|
|
Process user input:
|
|
Read user_input
|
|
If user_input starts with "/me":
|
|
Call handle_action(action)
|
|
Else if user_input starts with "saturn":
|
|
If user_input is "saturn check":
|
|
Call check_saturn_mode_status() # Call the check_saturn_mode_status function
|
|
Else if user_input is "saturn switch":
|
|
Call toggle_saturn_mode() # Call the toggle_saturn_mode function
|
|
Else if user_input is "saturn help":
|
|
Call display_help_information() # Call the display_help_information function
|
|
Else:
|
|
Call assistant.reply(user_input)
|
|
Else:
|
|
Call assistant.reply(user_input)
|
|
|
|
hiya
|