From 68b25a7d53166c5f45f19939c67a3570adf73906 Mon Sep 17 00:00:00 2001 From: K2Cr2O1 <2221577113@qq.com> Date: Tue, 24 Mar 2026 14:43:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=98=B5=E7=A7=B0?= =?UTF-8?q?=E5=92=8C=E7=94=A8=E6=88=B7=E5=90=8D=E7=9A=84=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改QQ群消息处理中昵称获取顺序,优先使用昵称而非群名片 移除Discord消息转换中global_name的检查,直接使用用户名 --- adapters/router.py | 3 +-- plugins/discord-cross/handlers.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/adapters/router.py b/adapters/router.py index 372540e..e1c97ef 100644 --- a/adapters/router.py +++ b/adapters/router.py @@ -356,8 +356,7 @@ class DiscordToOneBotConverter: # 注入 Discord 特定信息(用于跨平台插件识别) discord_channel_id = discord_message.channel.id if not isinstance(discord_message.channel, discord.DMChannel) else None - # 使用 global_name (显示名称/昵称) 如果存在,否则使用 name (用户名) - discord_username = getattr(discord_message.author, 'global_name', None) or discord_message.author.name + discord_username = discord_message.author.name discord_discriminator = f"#{discord_message.author.discriminator}" if discord_message.author.discriminator != "0" else "" if is_private: diff --git a/plugins/discord-cross/handlers.py b/plugins/discord-cross/handlers.py index bc92f9a..1e13b51 100644 --- a/plugins/discord-cross/handlers.py +++ b/plugins/discord-cross/handlers.py @@ -148,7 +148,7 @@ async def handle_qq_group_message(event: GroupMessageEvent): group_name = f"群{group_id}" await handle_qq_message( - nickname=event.sender.card or event.sender.nickname or str(event.user_id), + nickname=event.sender.nickname or event.sender.card or str(event.user_id), user_id=event.user_id, group_name=group_name, group_id=group_id,