fix stuff
This commit is contained in:
parent
fdc54fe3bc
commit
e10e364a2a
35
saturn.py
35
saturn.py
|
@ -1,5 +1,20 @@
|
||||||
saturn_mode_enabled = False
|
saturn_mode_enabled = False
|
||||||
|
|
||||||
|
class Assistant: # You are the assistant
|
||||||
|
def normal_message(self, message):
|
||||||
|
print("ꕤ: " + response(message))
|
||||||
|
|
||||||
|
def saturn_message(self, message):
|
||||||
|
print("🪐: " + concise_response(message)) # Use concise responses for Saturn mode messages
|
||||||
|
|
||||||
|
def reply(self, message):
|
||||||
|
if saturn_mode_enabled:
|
||||||
|
self.saturn_message(message)
|
||||||
|
else:
|
||||||
|
self.normal_message(message) # Use display_message() for regular messages
|
||||||
|
|
||||||
|
assistant = Assistant()
|
||||||
|
|
||||||
def toggle_saturn_mode():
|
def toggle_saturn_mode():
|
||||||
global saturn_mode_enabled
|
global saturn_mode_enabled
|
||||||
saturn_mode_enabled = not saturn_mode_enabled
|
saturn_mode_enabled = not saturn_mode_enabled
|
||||||
|
@ -15,13 +30,6 @@ def handle_action(action):
|
||||||
prefix = "/me " if saturn_mode_enabled else ""
|
prefix = "/me " if saturn_mode_enabled else ""
|
||||||
print(prefix + action)
|
print(prefix + action)
|
||||||
|
|
||||||
def reply(message):
|
|
||||||
if saturn_mode_enabled:
|
|
||||||
assistant.saturn_message(message)
|
|
||||||
else:
|
|
||||||
assistant.display_message(message)
|
|
||||||
|
|
||||||
|
|
||||||
def handle_help():
|
def handle_help():
|
||||||
help_message = """
|
help_message = """
|
||||||
Here's what you can do:
|
Here's what you can do:
|
||||||
|
@ -30,7 +38,7 @@ Here's what you can do:
|
||||||
* Use `saturn switch` to switch Saturn mode.
|
* Use `saturn switch` to switch Saturn mode.
|
||||||
* Use `saturn help` to get help.
|
* Use `saturn help` to get help.
|
||||||
"""
|
"""
|
||||||
assistant_display_message(help_message)
|
assistant.display_message(help_message)
|
||||||
|
|
||||||
def handle_user_input(user_input):
|
def handle_user_input(user_input):
|
||||||
if user_input.startswith("/me"):
|
if user_input.startswith("/me"):
|
||||||
|
@ -43,16 +51,7 @@ def handle_user_input(user_input):
|
||||||
elif user_input == "saturn help":
|
elif user_input == "saturn help":
|
||||||
handle_help()
|
handle_help()
|
||||||
else:
|
else:
|
||||||
reply(user_input)
|
assistant.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()
|
user_input = input()
|
||||||
handle_user_input(user_input)
|
handle_user_input(user_input)
|
||||||
|
|
Loading…
Reference in a new issue