From 0dbe32e2dc2bd07a98e61bc20f9fad5d0cc8f921 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 14:38:12 +0800 Subject: [PATCH] feat: add Discord pre-ack emoji support (#5609) * Initial plan * feat: add Discord pre-ack emoji support Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com> * feat: add Discord pre-acknowledgment emoji configuration in English and Chinese locales --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com> Co-authored-by: Soulter <905617992@qq.com> --- astrbot/core/config/default.py | 13 +++++++++++++ astrbot/core/pipeline/preprocess_stage/stage.py | 2 +- .../locales/en-US/features/config-metadata.json | 11 +++++++++++ .../locales/zh-CN/features/config-metadata.json | 11 +++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index d5ecb4398..3ba68fa89 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -3446,6 +3446,19 @@ CONFIG_METADATA_3 = { "platform_specific.telegram.pre_ack_emoji.enable": True, }, }, + "platform_specific.discord.pre_ack_emoji.enable": { + "description": "[Discord] 启用预回应表情", + "type": "bool", + }, + "platform_specific.discord.pre_ack_emoji.emojis": { + "description": "表情列表(Unicode 或自定义表情名)", + "type": "list", + "items": {"type": "string"}, + "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳", + "condition": { + "platform_specific.discord.pre_ack_emoji.enable": True, + }, + }, }, }, }, diff --git a/astrbot/core/pipeline/preprocess_stage/stage.py b/astrbot/core/pipeline/preprocess_stage/stage.py index 6544f85c1..464f584f8 100644 --- a/astrbot/core/pipeline/preprocess_stage/stage.py +++ b/astrbot/core/pipeline/preprocess_stage/stage.py @@ -27,7 +27,7 @@ class PreProcessStage(Stage): ) -> None | AsyncGenerator[None, None]: """在处理事件之前的预处理""" # 平台特异配置:platform_specific..pre_ack_emoji - supported = {"telegram", "lark"} + supported = {"telegram", "lark", "discord"} platform = event.get_platform_name() cfg = ( self.config.get("platform_specific", {}) diff --git a/dashboard/src/i18n/locales/en-US/features/config-metadata.json b/dashboard/src/i18n/locales/en-US/features/config-metadata.json index b59774ee8..b8473dae6 100644 --- a/dashboard/src/i18n/locales/en-US/features/config-metadata.json +++ b/dashboard/src/i18n/locales/en-US/features/config-metadata.json @@ -738,6 +738,17 @@ "hint": "Telegram only supports a fixed reaction set, reference: [https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" } } + }, + "discord": { + "pre_ack_emoji": { + "enable": { + "description": "[Discord] Enable Pre-acknowledgment Emoji" + }, + "emojis": { + "description": "Emoji List (Unicode or Custom Emoji Name)", + "hint": "Enter Unicode emoji symbols, e.g., 👍, 🤔, ⏳" + } + } } } } diff --git a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json index 4bd3e4260..e3a52258f 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json +++ b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json @@ -741,6 +741,17 @@ "hint": "Telegram 仅支持固定反应集合,参考:[https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" } } + }, + "discord": { + "pre_ack_emoji": { + "enable": { + "description": "[Discord] 启用预回应表情" + }, + "emojis": { + "description": "表情列表(Unicode 或自定义表情名)", + "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳" + } + } } } }