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
This commit is contained in:
Abigail Gold 2019-10-08 18:39:05 -04:00 committed by GitHub
parent 0cc613ef8a
commit 5ebcebcac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

19
main.py
View File

@ -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