Skip to content

Commit a7872f5

Browse files
committed
Use partial messageable and message to tidy up infractions
1 parent 4b04acb commit a7872f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bot/exts/moderation/infraction/_scheduler.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from discord.ext.commands import Context
1313
from pydis_core.site_api import ResponseCodeError
1414
from pydis_core.utils import scheduling
15-
from pydis_core.utils.channel import get_or_fetch_channel
1615

1716
from bot import constants
1817
from bot.bot import Bot
@@ -115,9 +114,9 @@ async def _delete_infraction_message(
115114
This is used to delete infraction messages after a certain period of time.
116115
"""
117116
try:
118-
channel = await get_or_fetch_channel(self.bot, channel_id)
119-
message = await channel.fetch_message(message_id)
120-
await message.delete()
117+
partial_channel = self.bot.get_partial_messageable(channel_id)
118+
partial_message = partial_channel.get_partial_message(message_id)
119+
await partial_message.delete()
121120
log.trace(f"Deleted infraction message {message_id} in channel {channel_id}.")
122121
except discord.NotFound:
123122
log.warning(f"Channel or message {message_id} not found in channel {channel_id}.")

0 commit comments

Comments
 (0)