fix(logger): fixed some stuff

This commit is contained in:
Seaswimmer 2024-05-24 03:03:04 -04:00
parent 24703bb32f
commit 6fbd2531a8
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -15,13 +15,17 @@ class Logger(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_raw_message_delete(self, payload: discord.RawMessageDeleteEvent) -> None: async def on_raw_message_delete(self, payload: discord.RawMessageDeleteEvent) -> None:
if not payload.guild_id: if payload.guild_id:
guild = self.bot.get_guild(payload.guild_id)
if guild is None:
return
else:
return return
if await self.bot.cog_disabled_in_guild(self, payload.guild_id): if await self.bot.cog_disabled_in_guild(self, guild):
return return
if payload.channel_id in await config.guild(payload.guild_id).message_ignored_channels(): if payload.channel_id in await config.guild(guild).message_ignored_channels():
return return
if payload.cached_message: if payload.cached_message:
@ -35,7 +39,7 @@ class Logger(commands.Cog):
author = payload.cached_message.author author = payload.cached_message.author
c = await config.guild(payload.guild_id).message_delete_channel() c = await config.guild(guild).message_delete_channel()
if c: if c:
channel = self.bot.get_channel(c) channel = self.bot.get_channel(c)
if channel: if channel: