mirror of
https://github.com/miaowware/qrm2.git
synced 2025-07-30 11:52:26 -04:00
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:
parent
0cc613ef8a
commit
5ebcebcac2
19
main.py
19
main.py
@ -34,14 +34,17 @@ class GlobalSettings(commands.Cog):
|
|||||||
self.keys = keys
|
self.keys = keys
|
||||||
self.info = info
|
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
|
self.debug = debug_mode
|
||||||
|
|
||||||
|
|
||||||
# --- Bot setup ---
|
# --- 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 ---
|
# --- Helper functions ---
|
||||||
|
|
||||||
@ -121,22 +124,24 @@ _ensure_activity.start()
|
|||||||
try:
|
try:
|
||||||
bot.run(keys.discord_token)
|
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:
|
if debug_mode:
|
||||||
raise
|
raise
|
||||||
raise SystemExit("Error: Failed to authenticate: {}".format(ex))
|
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:
|
if debug_mode:
|
||||||
raise
|
raise
|
||||||
raise SystemExit("Error: Discord gateway connection closed: [Code {}] {}".format(ex.code, ex.reason))
|
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:
|
if debug_mode:
|
||||||
raise
|
raise
|
||||||
raise SystemExit("ConnectionResetError: {}".format(ex))
|
raise SystemExit("ConnectionResetError: {}".format(ex))
|
||||||
|
|
||||||
|
|
||||||
# --- Exit ---
|
# --- Exit ---
|
||||||
# Codes for the wrapper shell script:
|
# Codes for the wrapper shell script:
|
||||||
# 0 - Clean exit, don't restart
|
# 0 - Clean exit, don't restart
|
||||||
|
Loading…
x
Reference in New Issue
Block a user