mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 16:20:21 +00:00
feat(telegram): improve DM topics support (#30579) (thanks @kesor)
This commit is contained in:
@@ -79,6 +79,8 @@ export type TelegramAccountConfig = {
|
||||
/** Control reply threading when reply tags are present (off|first|all). */
|
||||
replyToMode?: ReplyToMode;
|
||||
groups?: Record<string, TelegramGroupConfig>;
|
||||
/** Per-DM configuration for Telegram DM topics (key is chat ID). */
|
||||
direct?: Record<string, TelegramDirectConfig>;
|
||||
/** DM allowlist (numeric Telegram user IDs). Onboarding can resolve @username to IDs. */
|
||||
allowFrom?: Array<string | number>;
|
||||
/** Default delivery target for CLI `--deliver` when no explicit `--reply-to` is provided. */
|
||||
@@ -204,6 +206,26 @@ export type TelegramGroupConfig = {
|
||||
systemPrompt?: string;
|
||||
};
|
||||
|
||||
export type TelegramDirectConfig = {
|
||||
/** Per-DM override for DM message policy (open|disabled|allowlist). */
|
||||
dmPolicy?: DmPolicy;
|
||||
/** Optional tool policy overrides for this DM. */
|
||||
tools?: GroupToolPolicyConfig;
|
||||
toolsBySender?: GroupToolPolicyBySenderConfig;
|
||||
/** If specified, only load these skills for this DM (when no topic). Omit = all skills; empty = no skills. */
|
||||
skills?: string[];
|
||||
/** Per-topic configuration for DM topics (key is message_thread_id as string) */
|
||||
topics?: Record<string, TelegramTopicConfig>;
|
||||
/** If false, disable the bot for this DM (and its topics). */
|
||||
enabled?: boolean;
|
||||
/** If true, require messages to be from a topic when topics are enabled. */
|
||||
requireTopic?: boolean;
|
||||
/** Optional allowlist for DM senders (numeric Telegram user IDs). */
|
||||
allowFrom?: Array<string | number>;
|
||||
/** Optional system prompt snippet for this DM. */
|
||||
systemPrompt?: string;
|
||||
};
|
||||
|
||||
export type TelegramConfig = {
|
||||
/** Optional per-account Telegram configuration (multi-account). */
|
||||
accounts?: Record<string, TelegramAccountConfig>;
|
||||
|
||||
Reference in New Issue
Block a user