Skip to content

Commit 0dbe32e

Browse files
CopilotSoulter
andauthored
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>
1 parent 4e855a1 commit 0dbe32e

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

astrbot/core/config/default.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,6 +3446,19 @@ class ChatProviderTemplate(TypedDict):
34463446
"platform_specific.telegram.pre_ack_emoji.enable": True,
34473447
},
34483448
},
3449+
"platform_specific.discord.pre_ack_emoji.enable": {
3450+
"description": "[Discord] 启用预回应表情",
3451+
"type": "bool",
3452+
},
3453+
"platform_specific.discord.pre_ack_emoji.emojis": {
3454+
"description": "表情列表(Unicode 或自定义表情名)",
3455+
"type": "list",
3456+
"items": {"type": "string"},
3457+
"hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳",
3458+
"condition": {
3459+
"platform_specific.discord.pre_ack_emoji.enable": True,
3460+
},
3461+
},
34493462
},
34503463
},
34513464
},

astrbot/core/pipeline/preprocess_stage/stage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def process(
2727
) -> None | AsyncGenerator[None, None]:
2828
"""在处理事件之前的预处理"""
2929
# 平台特异配置:platform_specific.<platform>.pre_ack_emoji
30-
supported = {"telegram", "lark"}
30+
supported = {"telegram", "lark", "discord"}
3131
platform = event.get_platform_name()
3232
cfg = (
3333
self.config.get("platform_specific", {})

dashboard/src/i18n/locales/en-US/features/config-metadata.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,17 @@
738738
"hint": "Telegram only supports a fixed reaction set, reference: [https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)"
739739
}
740740
}
741+
},
742+
"discord": {
743+
"pre_ack_emoji": {
744+
"enable": {
745+
"description": "[Discord] Enable Pre-acknowledgment Emoji"
746+
},
747+
"emojis": {
748+
"description": "Emoji List (Unicode or Custom Emoji Name)",
749+
"hint": "Enter Unicode emoji symbols, e.g., 👍, 🤔, ⏳"
750+
}
751+
}
741752
}
742753
}
743754
}

dashboard/src/i18n/locales/zh-CN/features/config-metadata.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,17 @@
741741
"hint": "Telegram 仅支持固定反应集合,参考:[https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)"
742742
}
743743
}
744+
},
745+
"discord": {
746+
"pre_ack_emoji": {
747+
"enable": {
748+
"description": "[Discord] 启用预回应表情"
749+
},
750+
"emojis": {
751+
"description": "表情列表(Unicode 或自定义表情名)",
752+
"hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳"
753+
}
754+
}
744755
}
745756
}
746757
}

0 commit comments

Comments
 (0)