fix(shard): 🐛 Payphone.clean_message() using non-existent display_name for roles and channels.
This commit is contained in:
+7
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user