feat(dingtalk): support group subscriptions and card interaction events

This commit is contained in:
Hyu
2026-10-10 21:29:49 +08:00
parent 387cc9c30c
commit d2ec53ec91
15 changed files with 197 additions and 21 deletions
@@ -90,6 +90,10 @@ const DEBUG_EVENT_DEFINITIONS: Record<string, DebugEventDefinition> = {
messageField: 'text',
},
'message.deleted': deletion,
'dingtalk.card_action': {
fields: [user],
defaults: { space_id: 'dtv1.card//IM_GROUP.debug-group', card_instance_id: 'debug-card', action: 'confirm', data: {} },
},
'wecombot.enter_chat': {
fields: [user],
defaults: { chat_id: 'debug-user', chat_type: 'private', message_id: 'debug-entry', data: {} },
@@ -331,7 +331,14 @@ function eventLabel(event: string, t: TFunction) {
function eventDescription(event: string, t: TFunction) {
if (event === '*') return t('bots.eventDescriptions.all');
if (event.endsWith('.*')) return t('bots.eventDescriptions.namespace');
if (event.endsWith('.*')) {
const group = event.slice(0, -2);
const key = `bots.eventDescriptions.namespace_${group}`;
const description = t(key);
return description === key
? t('bots.eventDescriptions.namespace', { group })
: description;
}
const key = `bots.eventDescriptions.${event.replace(/\./g, '_')}`;
const description = t(key);
return description === key ? t('bots.eventDescriptions.custom') : description;