fix(shard): 🐛 Payphone.clean_message() using non-existent display_name for roles and channels.

This commit is contained in:
2025-03-16 02:38:51 -03:00
parent 548ad72d72
commit 26e4e0075c
+7 -2
View File
@@ -215,14 +215,19 @@ class Payphone(commands.AutoShardedBot):
"@everyone", f"@{constants.INVISIBLE_CHARACTER}everyone"
).replace("@here", f"@{constants.INVISIBLE_CHARACTER}here")
for mention in message.mentions + message.role_mentions:
for mention in message.mentions:
content = content.replace(
f"<@{mention.id}>", f"@**{mention.display_name}**"
)
for mention in message.role_mentions:
content = content.replace(
f"<@{mention.id}>", f"@**{mention.name}**"
)
for mention in message.channel_mentions:
content = content.replace(
f"<@{mention.id}>", f"#**{mention.display_name}**"
f"<@{mention.id}>", f"#**{mention.name}**"
)
return content