[Otherbot] A bit more filtering on event (#135)
This commit is contained in:
@@ -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"]:
|
||||
|
||||
Reference in New Issue
Block a user