@xmanrui/dsh-im 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/THIRD_PARTY_NOTICES.md +209 -0
  2. package/docs/client-integration.md +2 -2
  3. package/lib/client.js +1688 -233
  4. package/lib/index.js +322 -318
  5. package/package.json +1 -1
  6. package/plugin-src/client/channels/telegram/group-triggers-settings.js +393 -0
  7. package/plugin-src/client/delivery-settings.js +21 -1
  8. package/plugin-src/client/ds-bot-avatar-data.js +537 -0
  9. package/plugin-src/client/ds-bot-avatar.js +55 -0
  10. package/plugin-src/client/ds-bot-session-avatars.js +77 -0
  11. package/plugin-src/client/ds-bot-settings.js +194 -0
  12. package/plugin-src/client/i18n.js +59 -1
  13. package/plugin-src/client/index.js +12 -1
  14. package/plugin-src/client/plugin-page.js +3 -8
  15. package/plugin-src/client/styles.js +25 -5
  16. package/plugin-src/host/channels/dingtalk/production.mjs +2 -1
  17. package/plugin-src/host/channels/feishu/production.mjs +13 -5
  18. package/plugin-src/host/channels/qq/production.mjs +2 -1
  19. package/plugin-src/host/channels/shared/group-triggers-rpc.mjs +110 -0
  20. package/plugin-src/host/channels/shared/production.mjs +7 -1
  21. package/plugin-src/host/channels/slack/production.mjs +2 -1
  22. package/plugin-src/host/channels/telegram/index.mjs +1 -0
  23. package/plugin-src/host/channels/telegram/production.mjs +2 -0
  24. package/plugin-src/host/channels/telegram/rpc.mjs +17 -2
  25. package/plugin-src/host/channels/wecom/production.mjs +4 -1
  26. package/plugin-src/host/channels/wecom-app/production.mjs +2 -1
  27. package/plugin-src/host/channels/weixin/production.mjs +2 -1
  28. package/plugin-src/host/channels/whatsapp/production.mjs +2 -1
  29. package/plugin-src/host/delivery-adapter.mjs +89 -9
  30. package/plugin-src/host/delivery-rpc.mjs +33 -1
  31. package/plugin-src/host/delivery-service.mjs +70 -1
  32. package/plugin-src/host/delivery-suggestions.mjs +11 -0
  33. package/plugin-src/host/ds-bot-client.mjs +74 -0
  34. package/plugin-src/host/index.mjs +5 -1
  35. package/src/channels/feishu/feishu-cards.mjs +11 -7
  36. package/src/channels/shared/bot-workspace-store.mjs +136 -7
  37. package/src/channels/shared/group-history-store.mjs +26 -0
  38. package/src/channels/shared/i18n-en/feishu.mjs +1 -0
  39. package/src/channels/shared/i18n-en/wecom.mjs +4 -0
  40. package/src/channels/shared/session-binding-lock.mjs +2 -0
  41. package/src/channels/shared/workspace-session.mjs +5 -1
  42. package/src/channels/telegram/config-store.mjs +5 -1
  43. package/src/channels/telegram/group-triggers.mjs +229 -0
  44. package/src/channels/telegram/telegram-api.mjs +12 -0
  45. package/src/channels/telegram/telegram-controller.mjs +110 -1
  46. package/src/channels/telegram/telegram-runtime.mjs +15 -2
  47. package/src/channels/wecom/stream-supervisor.mjs +184 -0
  48. package/src/channels/wecom/wecom-bridge.mjs +25 -11
  49. package/src/channels/wecom/wecom-runtime.mjs +12 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmanrui/dsh-im",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "icon": "./assets/logo-plugin-message-link-gradient.webp",
5
5
  "description": "把微信、飞书、企微、钉钉、QQ、Telegram、WhatsApp、Slack、Discord、Matrix接入DSH。 Connect Telegram, WhatsApp, Slack, Discord, Matrix, WeChat, Feishu, WeCom, DingTalk, and QQ to DSH.",
6
6
  "keywords": [
@@ -0,0 +1,393 @@
1
+ /**
2
+ * Bot in groups: per-chat reply rules for the Telegram channel.
3
+ *
4
+ * Each rule answers one question — which group messages should wake the bot:
5
+ * never, only when it is mentioned or replied to, or every message; and whether
6
+ * that applies to anyone or only to a list of member IDs.
7
+ *
8
+ * The rule set lives in the bot config, so saving restarts the runtime and the
9
+ * new behaviour applies to the next incoming message.
10
+ */
11
+ import * as React from 'react';
12
+
13
+ import { h } from '../../i18n.js';
14
+
15
+ export const GROUP_TRIGGERS_ENDPOINTS = Object.freeze({
16
+ get: 'bot.group-triggers.get',
17
+ set: 'bot.group-triggers.set',
18
+ resolve: 'bot.group-triggers.resolve',
19
+ });
20
+
21
+ export const GROUP_TRIGGER_MODE_OPTIONS = Object.freeze([
22
+ Object.freeze({ value: 'off', label: '不响应' }),
23
+ Object.freeze({ value: 'mention', label: '被 @ 或回复时(任何人)' }),
24
+ Object.freeze({ value: 'mention-list', label: '被 @ 或回复时(仅名单成员)' }),
25
+ Object.freeze({ value: 'all', label: '所有消息(任何人)' }),
26
+ Object.freeze({ value: 'all-list', label: '所有消息(仅名单成员)' }),
27
+ ]);
28
+
29
+ const LIST_MODES = new Set(['mention-list', 'all-list']);
30
+ const DEFAULT_ENTRY = Object.freeze({ mode: 'off', sendersText: '' });
31
+
32
+ function isListMode(mode) {
33
+ return LIST_MODES.has(mode);
34
+ }
35
+
36
+ function modeLabel(value) {
37
+ return GROUP_TRIGGER_MODE_OPTIONS.find((option) => option.value === value)?.label
38
+ ?? GROUP_TRIGGER_MODE_OPTIONS[0].label;
39
+ }
40
+
41
+ export function splitMemberIds(text) {
42
+ return String(text ?? '').split(/[\s,;]+/).map((item) => item.trim()).filter(Boolean);
43
+ }
44
+
45
+ /** One stored rule → editor state (members stay as the owner typed them). */
46
+ export function entryFromConfig(value) {
47
+ const mode = GROUP_TRIGGER_MODE_OPTIONS.some((option) => option.value === value?.mode)
48
+ ? value.mode : 'off';
49
+ const senders = Array.isArray(value?.senders) ? value.senders.map((id) => String(id)) : [];
50
+ return { mode, sendersText: senders.join('\n') };
51
+ }
52
+
53
+ /** RPC snapshot → editor state. */
54
+ export function stateFromSnapshot(value) {
55
+ const source = value && typeof value === 'object' ? value : {};
56
+ const groups = {};
57
+ for (const [chatId, entry] of Object.entries(source.groups ?? {})) {
58
+ groups[String(chatId)] = entryFromConfig(entry);
59
+ }
60
+ const seen = {};
61
+ for (const entry of Array.isArray(source.seen) ? source.seen : []) {
62
+ const chatId = typeof entry?.chatId === 'string' ? entry.chatId : '';
63
+ if (!chatId) continue;
64
+ seen[chatId] = {
65
+ title: typeof entry.title === 'string' ? entry.title : null,
66
+ type: typeof entry.type === 'string' ? entry.type : null,
67
+ lastSeenAt: typeof entry.lastSeenAt === 'string' ? entry.lastSeenAt : null,
68
+ lastSenderName: typeof entry.lastSenderName === 'string' ? entry.lastSenderName : null,
69
+ };
70
+ }
71
+ return { defaults: entryFromConfig(source.defaults), groups, seen, removed: [] };
72
+ }
73
+
74
+ function unwrapRpcResult(result) {
75
+ if (result?.ok === false) {
76
+ const error = new Error(result.error?.message || '无法读取或保存群聊设置,请稍后重试。');
77
+ error.code = result.error?.code;
78
+ throw error;
79
+ }
80
+ return result?.ok === true ? result.value : result;
81
+ }
82
+
83
+ function formatMoment(value) {
84
+ if (typeof value !== 'string' || !value) return '—';
85
+ return value.slice(0, 16).replace('T', ' ');
86
+ }
87
+
88
+ function memberHelp(entry) {
89
+ if (splitMemberIds(entry.sendersText).length > 0) return null;
90
+ return isListMode(entry.mode)
91
+ ? '名单为空:该模式不会响应任何成员。'
92
+ : '当前模式不使用名单。';
93
+ }
94
+
95
+ function ModeField({ entry, onChange, disabled }) {
96
+ return h('label', { className: 'dim-accessField' },
97
+ h('span', null, '响应条件'),
98
+ h('select', {
99
+ value: entry.mode,
100
+ disabled,
101
+ onChange: (event) => onChange(event.target.value),
102
+ }, GROUP_TRIGGER_MODE_OPTIONS.map((option) => h('option', {
103
+ key: option.value,
104
+ value: option.value,
105
+ }, option.label))));
106
+ }
107
+
108
+ function MembersField({ entry, onChange, disabled }) {
109
+ const help = memberHelp(entry);
110
+ return h('label', { className: 'dim-accessField' },
111
+ h('span', null, '成员名单'),
112
+ h('textarea', {
113
+ ...AUTOFILL_GUARD,
114
+ value: entry.sendersText,
115
+ rows: 2,
116
+ disabled,
117
+ spellCheck: false,
118
+ placeholder: '123456789',
119
+ onChange: (event) => onChange(event.target.value),
120
+ }),
121
+ help ? h('span', { className: 'dim-channelHelp' }, help) : null);
122
+ }
123
+
124
+ function ValueRow({ label, value, suffix }) {
125
+ return h('div', { className: 'dim-accessField' },
126
+ h('span', null, label),
127
+ h('code', { className: 'dim-groupTriggerValue' }, value, suffix ?? null));
128
+ }
129
+
130
+ /** Keeps browser password managers from treating these fields as logins. */
131
+ const AUTOFILL_GUARD = Object.freeze({
132
+ autoComplete: 'off',
133
+ autoCapitalize: 'none',
134
+ autoCorrect: 'off',
135
+ 'data-1p-ignore': 'true',
136
+ 'data-lpignore': 'true',
137
+ 'data-bwignore': 'true',
138
+ 'data-form-type': 'other',
139
+ });
140
+
141
+ export function TelegramGroupTriggersSettings({ account, rpcCall }) {
142
+ const [state, setState] = React.useState(null);
143
+ const [addDraft, setAddDraft] = React.useState(null);
144
+ const [manualId, setManualId] = React.useState('');
145
+ const [phase, setPhase] = React.useState('loading');
146
+ const [saving, setSaving] = React.useState(false);
147
+ const [resolving, setResolving] = React.useState(false);
148
+ const [feedback, setFeedback] = React.useState(null);
149
+
150
+ const botId = account?.botId;
151
+
152
+ const load = React.useCallback(async () => {
153
+ setPhase('loading');
154
+ setFeedback(null);
155
+ try {
156
+ const value = unwrapRpcResult(await rpcCall(GROUP_TRIGGERS_ENDPOINTS.get, { botId }));
157
+ setState(stateFromSnapshot(value));
158
+ // The add form always starts blank: it is a new rule, not a copy of the
159
+ // defaults, so the owner never edits the wrong card by accident.
160
+ setAddDraft(null);
161
+ setPhase('ready');
162
+ } catch (error) {
163
+ setPhase('error');
164
+ setFeedback({ tone: 'error', message: error?.message || '无法读取群聊设置,请稍后重试。' });
165
+ }
166
+ }, [botId, rpcCall]);
167
+
168
+ React.useEffect(() => { void load(); }, [load]);
169
+
170
+ if (phase === 'loading') {
171
+ return h('div', { className: 'dim-accessState', 'aria-busy': 'true' }, '正在读取群聊设置…');
172
+ }
173
+ if (phase === 'error' || !state) {
174
+ return h('div', { className: 'dim-accessState', role: 'alert' },
175
+ h('p', null, feedback?.message || '无法读取群聊设置,请稍后重试。'),
176
+ h('button', { type: 'button', className: 'dim-deliveryButton', onClick: () => void load() },
177
+ '重试'));
178
+ }
179
+
180
+ const removed = new Set(state.removed);
181
+ const chatIds = [...new Set([...Object.keys(state.groups), ...Object.keys(state.seen)])]
182
+ .filter((chatId) => !removed.has(chatId));
183
+ const addEntry = addDraft ?? DEFAULT_ENTRY;
184
+
185
+ const updateDefault = (patch) => {
186
+ setState((current) => ({ ...current, defaults: { ...current.defaults, ...patch } }));
187
+ setFeedback(null);
188
+ };
189
+ const updateGroup = (chatId, patch) => {
190
+ setState((current) => ({
191
+ ...current,
192
+ groups: { ...current.groups, [chatId]: { ...(current.groups[chatId] ?? current.defaults), ...patch } },
193
+ }));
194
+ setFeedback(null);
195
+ };
196
+ const removeGroup = (chatId) => {
197
+ setState((current) => {
198
+ const groups = { ...current.groups };
199
+ delete groups[chatId];
200
+ return { ...current, groups, removed: [...current.removed, chatId] };
201
+ });
202
+ setFeedback({ tone: 'success', message: '已从列表移除,保存后生效。' });
203
+ };
204
+ const addGroup = async () => {
205
+ const raw = manualId.replace(/[\s\u00a0]+/g, '');
206
+ if (!raw) return;
207
+ setResolving(true);
208
+ setFeedback(null);
209
+ try {
210
+ const resolved = unwrapRpcResult(await rpcCall(GROUP_TRIGGERS_ENDPOINTS.resolve, { botId, input: raw }));
211
+ const chatId = typeof resolved?.chatId === 'string' ? resolved.chatId : '';
212
+ if (!chatId) throw new Error('无法解析该群聊,请重试或填写数字群 ID。');
213
+ // A chat already carrying a rule cannot be added twice; a chat that is
214
+ // only known from the archive is configurable, so it is not a duplicate.
215
+ if (Object.hasOwn(state.groups, chatId)) {
216
+ setFeedback({
217
+ tone: 'error',
218
+ message: '该群已在列表中,请编辑上方的卡片。',
219
+ detail: chatId,
220
+ });
221
+ return;
222
+ }
223
+ setState((current) => ({
224
+ ...current,
225
+ groups: { ...current.groups, [chatId]: { ...addEntry } },
226
+ // Re-adding a hidden chat must undo the previous removal.
227
+ removed: current.removed.filter((entry) => entry !== chatId),
228
+ seen: resolved?.title
229
+ ? { ...current.seen, [chatId]: { ...(current.seen[chatId] ?? {}), title: resolved.title } }
230
+ : current.seen,
231
+ }));
232
+ setManualId('');
233
+ setAddDraft(null);
234
+ setFeedback({
235
+ tone: 'success',
236
+ message: resolved?.verified === false
237
+ ? '已添加。Telegram 未确认该群(机器人可能还不在群里),保存后生效。'
238
+ : '已添加,保存后生效。',
239
+ });
240
+ } catch (error) {
241
+ setFeedback({ tone: 'error', message: error?.message || '无法解析该群聊,请重试或填写数字群 ID。' });
242
+ } finally {
243
+ setResolving(false);
244
+ }
245
+ };
246
+ const save = async (event) => {
247
+ event.preventDefault();
248
+ setSaving(true);
249
+ setFeedback(null);
250
+ try {
251
+ const groups = {};
252
+ for (const [chatId, entry] of Object.entries(state.groups)) {
253
+ groups[chatId] = { mode: entry.mode, senders: splitMemberIds(entry.sendersText) };
254
+ }
255
+ const value = unwrapRpcResult(await rpcCall(GROUP_TRIGGERS_ENDPOINTS.set, {
256
+ botId,
257
+ config: {
258
+ defaults: { mode: state.defaults.mode, senders: splitMemberIds(state.defaults.sendersText) },
259
+ groups,
260
+ },
261
+ removed: state.removed,
262
+ }));
263
+ setState(stateFromSnapshot(value));
264
+ setAddDraft(null);
265
+ setFeedback({ tone: 'success', message: '群聊设置已保存。' });
266
+ } catch (error) {
267
+ setFeedback({ tone: 'error', message: error?.message || '无法保存群聊设置,请稍后重试。' });
268
+ } finally {
269
+ setSaving(false);
270
+ }
271
+ };
272
+
273
+ return h('form', { className: 'dim-accessPage', onSubmit: (event) => void save(event) },
274
+ h('fieldset', { className: 'dim-accessScene' },
275
+ h('legend', null, '新群聊默认设置'),
276
+ h('div', { className: 'dim-accessControls' },
277
+ h(ModeField, {
278
+ entry: state.defaults,
279
+ disabled: saving,
280
+ onChange: (mode) => updateDefault({ mode }),
281
+ })),
282
+ h(MembersField, {
283
+ entry: state.defaults,
284
+ disabled: saving,
285
+ onChange: (sendersText) => updateDefault({ sendersText }),
286
+ })),
287
+
288
+ chatIds.map((chatId) => {
289
+ const configured = Object.hasOwn(state.groups, chatId);
290
+ const entry = state.groups[chatId] ?? state.defaults;
291
+ const info = state.seen[chatId] ?? {};
292
+ return h('fieldset', { key: chatId, className: 'dim-accessScene' },
293
+ h('legend', null, info.title || chatId),
294
+ h(ValueRow, { label: '群 ID', value: chatId }),
295
+ info.title ? h(ValueRow, { label: '标题', value: info.title }) : null,
296
+ h(ValueRow, {
297
+ label: '最近活动',
298
+ value: `${formatMoment(info.lastSeenAt)}${info.lastSenderName ? ` · ${info.lastSenderName}` : ''}`,
299
+ }),
300
+ configured
301
+ ? h(ModeField, {
302
+ entry,
303
+ disabled: saving,
304
+ onChange: (mode) => updateGroup(chatId, { mode }),
305
+ })
306
+ : h(ValueRow, {
307
+ label: '响应条件',
308
+ value: modeLabel(state.defaults.mode),
309
+ suffix: '(默认)',
310
+ }),
311
+ configured
312
+ ? h(MembersField, {
313
+ entry,
314
+ disabled: saving,
315
+ onChange: (sendersText) => updateGroup(chatId, { sendersText }),
316
+ })
317
+ : null,
318
+ h('div', { className: 'dim-accessActions' },
319
+ configured
320
+ ? null
321
+ : h('button', {
322
+ type: 'button',
323
+ className: 'dim-deliveryButton',
324
+ 'data-kind': 'primary',
325
+ disabled: saving,
326
+ onClick: () => updateGroup(chatId, {}),
327
+ }, '自定义'),
328
+ h('button', {
329
+ type: 'button',
330
+ className: 'dim-deliveryButton',
331
+ 'data-kind': 'danger',
332
+ disabled: saving,
333
+ onClick: () => removeGroup(chatId),
334
+ }, '× 移除')));
335
+ }),
336
+
337
+ h('fieldset', { className: 'dim-accessScene' },
338
+ h('legend', null, '添加群聊'),
339
+ h('label', { className: 'dim-accessField' },
340
+ h('span', null, '群 ID、@用户名或消息链接'),
341
+ h('textarea', {
342
+ ...AUTOFILL_GUARD,
343
+ value: manualId,
344
+ rows: 1,
345
+ spellCheck: false,
346
+ placeholder: '-1001234567890',
347
+ style: { resize: 'none', minHeight: '2.4em', overflow: 'hidden' },
348
+ onChange: (event) => setManualId(event.target.value.replace(/[\s\u00a0]+/g, '')),
349
+ onKeyDown: (event) => {
350
+ if (event.key !== 'Enter') return;
351
+ event.preventDefault();
352
+ if (!saving && !resolving && manualId) void addGroup();
353
+ },
354
+ }),
355
+ h('span', { className: 'dim-channelHelp' },
356
+ '支持数字 ID、@用户名、t.me/<name> 或 t.me/c/<id>/<msg>;真实 ID 通过 getChat 解析。')),
357
+ h('div', { className: 'dim-accessControls' },
358
+ h(ModeField, {
359
+ entry: addEntry,
360
+ disabled: saving,
361
+ onChange: (mode) => setAddDraft({ ...addEntry, mode }),
362
+ })),
363
+ h(MembersField, {
364
+ entry: addEntry,
365
+ disabled: saving,
366
+ onChange: (sendersText) => setAddDraft({ ...addEntry, sendersText }),
367
+ }),
368
+ h('div', { className: 'dim-accessActions' },
369
+ h('button', {
370
+ type: 'button',
371
+ className: 'dim-deliveryButton',
372
+ 'data-kind': 'primary',
373
+ disabled: saving || resolving || !manualId,
374
+ onClick: () => void addGroup(),
375
+ }, resolving ? '…' : '+ 添加'))),
376
+
377
+ feedback
378
+ ? h('p', {
379
+ className: 'dim-accessFeedback',
380
+ 'data-tone': feedback.tone,
381
+ role: feedback.tone === 'error' ? 'alert' : 'status',
382
+ 'aria-live': 'polite',
383
+ }, feedback.message, feedback.detail ? h('code', { className: 'dim-groupTriggerValue' }, feedback.detail) : null)
384
+ : null,
385
+
386
+ h('div', { className: 'dim-accessActions' },
387
+ h('button', {
388
+ type: 'submit',
389
+ className: 'dim-deliveryButton',
390
+ 'data-kind': 'primary',
391
+ disabled: saving,
392
+ }, saving ? '正在保存…' : '保存群聊设置')));
393
+ }
@@ -3,9 +3,11 @@ import * as React from 'react';
3
3
  import { AccessPolicySettingsPage } from './access-policy-settings.js';
4
4
  import { BotGeneralSettingsPage } from './bot-general-settings.js';
5
5
  import { BotSettingsTabs } from './bot-settings-tabs.js';
6
+ import { DsBotSettingsPage } from './ds-bot-settings.js';
6
7
  import { FeishuGroupSettingsPage } from './channels/feishu/group-settings.js';
7
8
  import { FeishuVoiceSettingsPage } from './channels/feishu/voice-settings.js';
8
9
  import { FeishuSlashPanelSettingsPage } from './channels/feishu/slash-panel-settings.js';
10
+ import { TelegramGroupTriggersSettings } from './channels/telegram/group-triggers-settings.js';
9
11
  import { h, isEnglish, localizeText } from './i18n.js';
10
12
 
11
13
  export const DELIVERY_RPC_CHANNEL = '/dsh-im-delivery';
@@ -28,6 +30,7 @@ export const DELIVERY_ENDPOINTS = Object.freeze({
28
30
  export const BOT_SETTINGS_TABS = Object.freeze([
29
31
  Object.freeze({ id: 'general', label: '通用' }),
30
32
  Object.freeze({ id: 'delivery', label: '投递设置' }),
33
+ Object.freeze({ id: 'ds-bot', label: '绑定bot' }),
31
34
  Object.freeze({ id: 'access', label: '访问设置' }),
32
35
  ]);
33
36
 
@@ -38,8 +41,15 @@ export const FEISHU_BOT_SETTINGS_TABS = Object.freeze([
38
41
  Object.freeze({ id: 'voice', label: '语音交互' }),
39
42
  ]);
40
43
 
44
+ export const TELEGRAM_BOT_SETTINGS_TABS = Object.freeze([
45
+ ...BOT_SETTINGS_TABS,
46
+ Object.freeze({ id: 'groups', label: '机器人群聊行为' }),
47
+ ]);
48
+
41
49
  export function botSettingsTabsForChannel(channel) {
42
- return channel === 'feishu' ? FEISHU_BOT_SETTINGS_TABS : BOT_SETTINGS_TABS;
50
+ if (channel === 'feishu') return FEISHU_BOT_SETTINGS_TABS;
51
+ if (channel === 'telegram') return TELEGRAM_BOT_SETTINGS_TABS;
52
+ return BOT_SETTINGS_TABS;
43
53
  }
44
54
 
45
55
  const CHANNEL_DEFINITIONS = Object.freeze({
@@ -782,6 +792,10 @@ export function DeliveryTargetSettingsPage({
782
792
  },
783
793
  activeTab.id === 'general'
784
794
  ? h(BotGeneralSettingsPage, { key: `${channel}:${account.botId}`, channel, account, rpcCall: accessRpcCall })
795
+ : activeTab.id === 'ds-bot'
796
+ ? h(DsBotSettingsPage, {
797
+ key: account.botId, botId: account.botId, rpcCall: invoke,
798
+ })
785
799
  : activeTab.id === 'access'
786
800
  ? h(AccessPolicySettingsPage, {
787
801
  channel,
@@ -789,6 +803,12 @@ export function DeliveryTargetSettingsPage({
789
803
  rpcCall: accessRpcCall,
790
804
  onSaved: setAccessPolicy,
791
805
  })
806
+ : activeTab.id === 'groups' && channel === 'telegram'
807
+ ? h(TelegramGroupTriggersSettings, {
808
+ key: `${channel}:${account.botId}:groups`,
809
+ account,
810
+ rpcCall: accessRpcCall,
811
+ })
792
812
  : activeTab.id === 'group' && channel === 'feishu'
793
813
  ? h(FeishuGroupSettingsPage, {
794
814
  account,