initial
This commit is contained in:
commit
fdc54fe3bc
58
saturn.py
Normal file
58
saturn.py
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
saturn_mode_enabled = False
|
||||||
|
|
||||||
|
def toggle_saturn_mode():
|
||||||
|
global saturn_mode_enabled
|
||||||
|
saturn_mode_enabled = not saturn_mode_enabled
|
||||||
|
mode_status = 'enabled' if saturn_mode_enabled else 'disabled'
|
||||||
|
assistant.display_message(f"Saturn mode is now {mode_status}.")
|
||||||
|
|
||||||
|
def check_saturn_mode():
|
||||||
|
global saturn_mode_enabled
|
||||||
|
mode_status = 'enabled' if saturn_mode_enabled else 'disabled'
|
||||||
|
assistant.display_message(f"Saturn mode is currently {mode_status}.")
|
||||||
|
|
||||||
|
def handle_action(action):
|
||||||
|
prefix = "/me " if saturn_mode_enabled else ""
|
||||||
|
print(prefix + action)
|
||||||
|
|
||||||
|
def reply(message):
|
||||||
|
if saturn_mode_enabled:
|
||||||
|
assistant.saturn_message(message)
|
||||||
|
else:
|
||||||
|
assistant.display_message(message)
|
||||||
|
|
||||||
|
|
||||||
|
def handle_help():
|
||||||
|
help_message = """
|
||||||
|
Here's what you can do:
|
||||||
|
|
||||||
|
* Use `saturn check` to check the current Saturn mode.
|
||||||
|
* Use `saturn switch` to switch Saturn mode.
|
||||||
|
* Use `saturn help` to get help.
|
||||||
|
"""
|
||||||
|
assistant_display_message(help_message)
|
||||||
|
|
||||||
|
def handle_user_input(user_input):
|
||||||
|
if user_input.startswith("/me"):
|
||||||
|
handle_action(action)
|
||||||
|
elif user_input.startswith("saturn"):
|
||||||
|
if user_input == "saturn check":
|
||||||
|
check_saturn_mode()
|
||||||
|
elif user_input == "saturn switch":
|
||||||
|
toggle_saturn_mode()
|
||||||
|
elif user_input == "saturn help":
|
||||||
|
handle_help()
|
||||||
|
else:
|
||||||
|
reply(user_input)
|
||||||
|
|
||||||
|
class Assistant:
|
||||||
|
def display_message(self, message):
|
||||||
|
print("ꕤ: "+ response(message))
|
||||||
|
|
||||||
|
def concise_message(self, message):
|
||||||
|
print("🪐: ", concise_response(message))
|
||||||
|
|
||||||
|
assistant = Assistant()
|
||||||
|
|
||||||
|
user_input = input()
|
||||||
|
handle_user_input(user_input)
|
Loading…
Reference in a new issue