make functions clear
This commit is contained in:
parent
8020d70cd7
commit
2f1dcd6b2a
20
saturn.py
20
saturn.py
|
@ -15,7 +15,8 @@ Assistant class definition:
|
|||
|
||||
Create an instance of Assistant called assistant
|
||||
|
||||
Toggle Saturn mode on/off:
|
||||
# Toggle Saturn mode on/off
|
||||
define toggle_saturn_mode:
|
||||
If Saturn mode is enabled:
|
||||
Disable Saturn mode
|
||||
Set mode_status to "disabled"
|
||||
|
@ -24,21 +25,24 @@ Toggle Saturn mode on/off:
|
|||
Set mode_status to "enabled"
|
||||
Call status_message("Saturn mode is now " + mode_status)
|
||||
|
||||
Check if Saturn mode is enabled or disabled:
|
||||
# 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:
|
||||
# Handle user actions with optional prefix
|
||||
define handle_action with action:
|
||||
If Saturn mode is enabled:
|
||||
Set prefix to "/me "
|
||||
Else:
|
||||
Set prefix to ""
|
||||
Set prefix to nothing
|
||||
Print prefix + action
|
||||
|
||||
Handle help:
|
||||
# Display help information
|
||||
display_help_information:
|
||||
Set help_message to a multi-line string explaining available commands
|
||||
Call display_message(help_message)
|
||||
|
||||
|
@ -48,10 +52,10 @@ Process user input:
|
|||
Call handle_action(action)
|
||||
Else if user_input starts with "saturn":
|
||||
If user_input is "saturn check":
|
||||
Call check_saturn_mode()
|
||||
Call check_saturn_mode_status() # Call the check_saturn_mode_status function
|
||||
Else if user_input is "saturn switch":
|
||||
Call toggle_saturn_mode()
|
||||
Call toggle_saturn_mode() # Call the toggle_saturn_mode function
|
||||
Else if user_input is "saturn help":
|
||||
Call handle_help()
|
||||
Call display_help_information() # Call the display_help_information function
|
||||
Else:
|
||||
Call assistant.reply(user_input)
|
||||
|
|
Loading…
Reference in a new issue