display name --> handle

This commit is contained in:
david committed 2026-04-02 22:47:45 -03:00
1 parent 32345c8316
commit de2aa06119
1 file changed
+2 -2
+2 -2
View File
@@ -163,7 +163,7 @@ def resolve_mentions(content: str, guild) -> str: # thank you claude
return content
def replace(m):
member = guild.get_member(int(m.group(1)))
return f"@{member.display_name}" if member else m.group(0)
return f"@{member.name}" if member else m.group(0)
return re.sub(r'<@!?(\d+)>', replace, content)
def is_member_in_server(member: discord.Member) -> bool:
@@ -379,7 +379,7 @@ async def on_message(message):
mentioned = client.user.mentioned_in(message)
# if it replied to bot, treat it as a mention automatically
#if it replied to bot, treat it as a mention automatically
if replied_to_bot:
mentioned = True