fix(shard): 🐛 Fix not found error in get_or_fetch_channel().
This commit is contained in:
+6
-6
@@ -123,8 +123,12 @@ class Payphone(commands.AutoShardedBot):
|
|||||||
channel = self.get_channel(channel_id)
|
channel = self.get_channel(channel_id)
|
||||||
|
|
||||||
if channel is None:
|
if channel is None:
|
||||||
|
try:
|
||||||
return await self.fetch_channel(channel_id)
|
return await self.fetch_channel(channel_id)
|
||||||
|
|
||||||
|
except discord.errors.NotFound:
|
||||||
|
return None
|
||||||
|
|
||||||
return channel
|
return channel
|
||||||
|
|
||||||
async def get_prefix(
|
async def get_prefix(
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user