Merge branch 'main' into dev

This commit is contained in:
镀铬酸钾
2026-03-24 14:57:57 +08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -356,7 +356,8 @@ class DiscordToOneBotConverter:
# 注入 Discord 特定信息(用于跨平台插件识别)
discord_channel_id = discord_message.channel.id if not isinstance(discord_message.channel, discord.DMChannel) else None
discord_username = discord_message.author.name
# 使用 global_name (显示名称/昵称) 如果存在,否则使用 name (用户名)
discord_username = getattr(discord_message.author, 'global_name', None) or discord_message.author.name
discord_discriminator = f"#{discord_message.author.discriminator}" if discord_message.author.discriminator != "0" else ""
if is_private: