From 5ebcebcac2a81177ed6dba7beabc408aedc62866 Mon Sep 17 00:00:00 2001 From: Abigail Gold <5366828+classabbyamp@users.noreply.github.com> Date: Tue, 8 Oct 2019 18:39:05 -0400 Subject: [PATCH] updated embed colors, and linted some of main.py (#17) * updated embed colors, and linted some of main.py * fixed spacing, comments * fixed line continuations ;3 * Fix spacing --- main.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index d4ac98c..a715063 100644 --- a/main.py +++ b/main.py @@ -34,14 +34,17 @@ class GlobalSettings(commands.Cog): self.keys = keys self.info = info - self.colours = SimpleNamespace(good=0x2dc614, neutral=0x2044f7, bad=0xc91628) + self.colours = SimpleNamespace(good=0x43B581, + neutral=0x7289DA, + bad=0xF04747) self.debug = debug_mode # --- Bot setup --- -bot = commands.Bot(command_prefix=opt.prefix, description=info.description, help_command=commands.MinimalHelpCommand()) - +bot = commands.Bot(command_prefix=opt.prefix, + description=info.description, + help_command=commands.MinimalHelpCommand()) # --- Helper functions --- @@ -121,22 +124,24 @@ _ensure_activity.start() try: bot.run(keys.discord_token) -except discord.LoginFailure as ex: # Miscellaneous authentications errors: borked token and co +except discord.LoginFailure as ex: + # Miscellaneous authentications errors: borked token and co if debug_mode: raise raise SystemExit("Error: Failed to authenticate: {}".format(ex)) -except discord.ConnectionClosed as ex: # When the connection the the gateway (websocket) is closed +except discord.ConnectionClosed as ex: + # When the connection to the gateway (websocket) is closed if debug_mode: raise raise SystemExit("Error: Discord gateway connection closed: [Code {}] {}".format(ex.code, ex.reason)) -except ConnectionResetError as ex: # More generic connection reset error +except ConnectionResetError as ex: + # More generic connection reset error if debug_mode: raise raise SystemExit("ConnectionResetError: {}".format(ex)) - # --- Exit --- # Codes for the wrapper shell script: # 0 - Clean exit, don't restart