From eadf4787141e5b423dcd39445e72518f50ec1cac Mon Sep 17 00:00:00 2001 From: Michael H Date: Thu, 12 Dec 2019 20:00:57 -0500 Subject: [PATCH] Avoid touching config as much. (#88) Could cache some of this on load as well, but this is a really cheap way to reduce the times interacting with config for now. --- otherbot/otherbot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/otherbot/otherbot.py b/otherbot/otherbot.py index b9b3b7c..0309f18 100644 --- a/otherbot/otherbot.py +++ b/otherbot/otherbot.py @@ -88,6 +88,8 @@ class Otherbot(BaseCog): @listener() async def on_member_update(self, before, after): + if after.guild is None or not after.bot: + return data = await self.config.guild(after.guild).all() if after.status == discord.Status.offline and (after.id in data["watching"]): channel_object = self.bot.get_channel(data["reporting"])