From a7872f5db1ec244b41933a0ad09c761031acccb0 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 25 Jun 2025 00:27:11 +0100 Subject: Use partial messageable and message to tidy up infractions --- bot/exts/moderation/infraction/_scheduler.py | 7 +++---- 1 file 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}.") -- cgit v1.2.3