[Otherbot] A bit more filtering on event (#135)

This commit is contained in:
PredaaA
2020-07-07 20:45:31 +02:00
committed by GitHub
parent 1fe2af93a8
commit 18a7efcdf3

View File

@@ -11,6 +11,9 @@ class Otherbot(commands.Cog):
self.config.register_guild(**default_guild)
def cog_unload(self):
self.otherbot_cache.clear()
async def generate_cache(self):
self.otherbot_cache = await self.config.all_guilds()
@@ -92,6 +95,8 @@ class Otherbot(commands.Cog):
data = self.otherbot_cache.get(after.guild.id)
if data is None:
return
if not data["watching"]:
return
if after.status == discord.Status.offline and (after.id in data["watching"]):
channel_object = self.bot.get_channel(data["reporting"])
if not data["ping"]: