diff options
author | 2025-06-25 00:27:11 +0100 | |
---|---|---|
committer | 2025-06-25 00:30:16 +0100 | |
commit | a7872f5db1ec244b41933a0ad09c761031acccb0 (patch) | |
tree | 9ffb18c77f238a44c7bd2cd09bccf12d1fcc4f97 | |
parent | Drop log verbosity for forbidden infraction message deletions (diff) |
Use partial messageable and message to tidy up infractions
-rw-r--r-- | bot/exts/moderation/infraction/_scheduler.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/exts/moderation/infraction/_scheduler.py b/bot/exts/moderation/infraction/_scheduler.py index 0680f5307..e10d94ad6 100644 --- a/bot/exts/moderation/infraction/_scheduler.py +++ b/bot/exts/moderation/infraction/_scheduler.py @@ -12,7 +12,6 @@ from async_rediscache import RedisCache from discord.ext.commands import Context from pydis_core.site_api import ResponseCodeError from pydis_core.utils import scheduling -from pydis_core.utils.channel import get_or_fetch_channel from bot import constants from bot.bot import Bot @@ -115,9 +114,9 @@ class InfractionScheduler: This is used to delete infraction messages after a certain period of time. """ try: - channel = await get_or_fetch_channel(self.bot, channel_id) - message = await channel.fetch_message(message_id) - await message.delete() + partial_channel = self.bot.get_partial_messageable(channel_id) + partial_message = partial_channel.get_partial_message(message_id) + await partial_message.delete() log.trace(f"Deleted infraction message {message_id} in channel {channel_id}.") except discord.NotFound: log.warning(f"Channel or message {message_id} not found in channel {channel_id}.") |