From e10e364a2a57bef31e85acd2cf3274ed29aa5cdc Mon Sep 17 00:00:00 2001 From: Bit Borealis Date: Wed, 16 Aug 2023 07:24:46 +0000 Subject: [PATCH] fix stuff --- saturn.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/saturn.py b/saturn.py index ceaea0b..22f82d9 100644 --- a/saturn.py +++ b/saturn.py @@ -1,5 +1,20 @@ 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(): global 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 "" 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: @@ -30,7 +38,7 @@ Here's what you can do: * Use `saturn switch` to switch Saturn mode. * Use `saturn help` to get help. """ - assistant_display_message(help_message) + assistant.display_message(help_message) def handle_user_input(user_input): if user_input.startswith("/me"): @@ -43,16 +51,7 @@ def handle_user_input(user_input): 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() + assistant.reply(user_input) user_input = input() handle_user_input(user_input)