From 26e4e0075c9cfa506aa2eacbb1fea00341515344 Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Sun, 16 Mar 2025 02:38:51 -0300 Subject: [PATCH] fix(shard): :bug: `Payphone.clean_message()` using non-existent `display_name` for roles and channels. --- payphone/bot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/payphone/bot.py b/payphone/bot.py index e0c1f2c..c5cd37b 100644 --- a/payphone/bot.py +++ b/payphone/bot.py @@ -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