aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/__init__.py12
-rw-r--r--bot/__main__.py3
-rw-r--r--bot/cogs/modlog.py9
3 files changed, 10 insertions, 14 deletions
diff --git a/bot/__init__.py b/bot/__init__.py
index 5a446d71c..080e2a75a 100644
--- a/bot/__init__.py
+++ b/bot/__init__.py
@@ -89,11 +89,7 @@ for key, value in logging.Logger.manager.loggerDict.items():
# Silence aio_pika.pika.{callback,channel}, discord, PIL, and and websockets
-logging.getLogger("aio_pika.pika.callback").setLevel(logging.ERROR)
-logging.getLogger("aio_pika.pika.channel").setLevel(logging.ERROR)
-logging.getLogger("discord.client").setLevel(logging.ERROR)
-logging.getLogger("discord.gateway").setLevel(logging.ERROR)
-logging.getLogger("discord.state").setLevel(logging.ERROR)
-logging.getLogger("discord.http").setLevel(logging.ERROR)
-logging.getLogger("PIL.PngImagePlugin").setLevel(logging.ERROR)
-logging.getLogger("websockets.protocol").setLevel(logging.ERROR)
+logging.getLogger("aio_pika").setLevel(logging.ERROR)
+logging.getLogger("discord").setLevel(logging.ERROR)
+logging.getLogger("PIL").setLevel(logging.ERROR)
+logging.getLogger("websockets").setLevel(logging.ERROR)
diff --git a/bot/__main__.py b/bot/__main__.py
index 30d1b4c9a..e4dbbfcde 100644
--- a/bot/__main__.py
+++ b/bot/__main__.py
@@ -50,15 +50,14 @@ bot.load_extension("bot.cogs.bot")
bot.load_extension("bot.cogs.clean")
bot.load_extension("bot.cogs.cogs")
-
# Only load this in production
if not DEBUG_MODE:
+ bot.load_extension("bot.cogs.doc")
bot.load_extension("bot.cogs.verification")
# Feature cogs
bot.load_extension("bot.cogs.deployment")
bot.load_extension("bot.cogs.defcon")
-bot.load_extension("bot.cogs.doc")
bot.load_extension("bot.cogs.eval")
bot.load_extension("bot.cogs.fun")
bot.load_extension("bot.cogs.hiphopify")
diff --git a/bot/cogs/modlog.py b/bot/cogs/modlog.py
index 2f72d92fc..d302634d1 100644
--- a/bot/cogs/modlog.py
+++ b/bot/cogs/modlog.py
@@ -440,7 +440,7 @@ class ModLog:
if key in done or key in MEMBER_CHANGES_SUPPRESSED:
continue
- if key == "roles":
+ if key == "_roles":
new_roles = after.roles
old_roles = before.roles
@@ -453,10 +453,11 @@ class ModLog:
changes.append(f"**Role added:** {role.name} (`{role.id}`)")
else:
- new = value["new_value"]
- old = value["old_value"]
+ new = value.get("new_value")
+ old = value.get("old_value")
- changes.append(f"**{key.title()}:** `{old}` **->** `{new}`")
+ if new and old:
+ changes.append(f"**{key.title()}:** `{old}` **->** `{new}`")
done.append(key)