mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-21 16:05:19 +08:00
feat(dingtalk): support group subscriptions and card interaction events
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user