fix(shard): 🐛 Fix not found error in get_or_fetch_channel().

This commit is contained in:
2025-03-16 11:04:42 -03:00
parent 1e21d557d1
commit c4df5a31e7
+7 -7
View File
@@ -123,7 +123,11 @@ class Payphone(commands.AutoShardedBot):
channel = self.get_channel(channel_id) channel = self.get_channel(channel_id)
if channel is None: if channel is None:
return await self.fetch_channel(channel_id) try:
return await self.fetch_channel(channel_id)
except discord.errors.NotFound:
return None
return channel return channel
@@ -221,14 +225,10 @@ class Payphone(commands.AutoShardedBot):
) )
for mention in message.role_mentions: for mention in message.role_mentions:
content = content.replace( content = content.replace(f"<@{mention.id}>", f"@**{mention.name}**")
f"<@{mention.id}>", f"@**{mention.name}**"
)
for mention in message.channel_mentions: for mention in message.channel_mentions:
content = content.replace( content = content.replace(f"<@{mention.id}>", f"#**{mention.name}**")
f"<@{mention.id}>", f"#**{mention.name}**"
)
return content return content