From a3312cffda5cc951145a52907675d4248d28cf0a Mon Sep 17 00:00:00 2001 From: Yuuki Chan Date: Mon, 19 Feb 2024 15:15:58 +0900 Subject: [PATCH] Remove more (unnecessary) double quotes... --- elitebot.py | 21 ++++++++++++--------- plugins/commands.py | 6 +++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/elitebot.py b/elitebot.py index 2ca4067..4f2d53a 100755 --- a/elitebot.py +++ b/elitebot.py @@ -1,34 +1,37 @@ #!/usr/bin/env python3 import sys + from src.bot import Bot + def main(): if len(sys.argv) < 2: - print("Usage: python elitebot.py ") + print('Usage: python elitebot.py ') sys.exit(1) config_file = sys.argv[1] try: bot = Bot(config_file) except FileNotFoundError as e: - print(f"Config file not found: {e}") + print(f'Config file not found: {e}') sys.exit(1) except Exception as e: - print(f"Error loading bot: {e}") + print(f'Error loading bot: {e}') sys.exit(1) try: - print("EliteBot started successfully!") - bot.start() + print('EliteBot started successfully!') + bot.start() except Exception as e: - print(f"Error starting EliteBot: {e}") + print(f'Error starting EliteBot: {e}') sys.exit(1) -if __name__ == "__main__": + +if __name__ == '__main__': try: main() except KeyboardInterrupt: - print("\nEliteBot has been stopped.") + print('\nEliteBot has been stopped.') except Exception as e: - print(f"An unexpected error occurred: {e}") + print(f'An unexpected error occurred: {e}') diff --git a/plugins/commands.py b/plugins/commands.py index 318950e..47e145a 100644 --- a/plugins/commands.py +++ b/plugins/commands.py @@ -27,7 +27,7 @@ class Plugin(PluginBase): self.bot.ircsend(f'PART {message_parts[1]}') self.channel_manager.remove_channel(message_parts[1]) - elif message_parts[0] == "!quit": + elif message_parts[0] == '!quit': if len(message_parts) == 0: quit_message = 'EliteBot!' else: @@ -37,9 +37,9 @@ class Plugin(PluginBase): self.bot.connected = False sys.exit() - elif message_parts[0] == "!raw": + elif message_parts[0] == '!raw': if len(message_parts) > 1: - if message_parts[1].upper() == "PRIVMSG" and len(message_parts) > 3: + if message_parts[1].upper() == 'PRIVMSG' and len(message_parts) > 3: raw_command = ' '.join(message_parts[1:3]) + " :" + ' '.join(message_parts[3:]) else: raw_command = ' '.join(message_parts[1:])