From 029e9c84affe18dbf9401185f7f68439cc15743a Mon Sep 17 00:00:00 2001 From: NLKASHEI Date: Thu, 2 Jul 2026 10:36:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86DISCORD=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=99=A8=E6=B3=A8=E5=86=8C=E5=91=BD=E4=BB=A4=E6=AD=A3?= =?UTF-8?q?=E5=88=99=E8=BF=87=E4=BA=8E=E4=B8=A5=E6=A0=BC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#9102)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复了DISCORD适配器注册命令正则过于严格的问题 * Update astrbot/core/platform/sources/discord/discord_platform_adapter.py # Discord 支持 Unicode 命令名(如中文),放宽匹配并确保全小写 Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../core/platform/sources/discord/discord_platform_adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/platform/sources/discord/discord_platform_adapter.py b/astrbot/core/platform/sources/discord/discord_platform_adapter.py index 0095912dc..2a690c597 100644 --- a/astrbot/core/platform/sources/discord/discord_platform_adapter.py +++ b/astrbot/core/platform/sources/discord/discord_platform_adapter.py @@ -565,7 +565,7 @@ class DiscordPlatformAdapter(Platform): return None # Discord 斜杠指令名称规范 - if not re.match(r"^[a-z0-9_-]{1,32}$", cmd_name): + if cmd_name != cmd_name.lower() or not re.match(r"^[-_'\\w]{1,32}$", cmd_name): logger.debug(f"[Discord] Skipping invalid slash command format: {cmd_name}") return None