mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:04:33 +00:00
refactor(config): dedupe WhatsApp group + ack types
This commit is contained in:
@@ -14,6 +14,27 @@ export type WhatsAppActionConfig = {
|
|||||||
polls?: boolean;
|
polls?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type WhatsAppGroupConfig = {
|
||||||
|
requireMention?: boolean;
|
||||||
|
tools?: GroupToolPolicyConfig;
|
||||||
|
toolsBySender?: GroupToolPolicyBySenderConfig;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type WhatsAppAckReactionConfig = {
|
||||||
|
/** Emoji to use for acknowledgment (e.g., "👀"). Empty = disabled. */
|
||||||
|
emoji?: string;
|
||||||
|
/** Send reactions in direct chats. Default: true. */
|
||||||
|
direct?: boolean;
|
||||||
|
/**
|
||||||
|
* Send reactions in group chats:
|
||||||
|
* - "always": react to all group messages
|
||||||
|
* - "mentions": react only when bot is mentioned
|
||||||
|
* - "never": never react in groups
|
||||||
|
* Default: "mentions"
|
||||||
|
*/
|
||||||
|
group?: "always" | "mentions" | "never";
|
||||||
|
};
|
||||||
|
|
||||||
export type WhatsAppConfig = {
|
export type WhatsAppConfig = {
|
||||||
/** Optional per-account WhatsApp configuration (multi-account). */
|
/** Optional per-account WhatsApp configuration (multi-account). */
|
||||||
accounts?: Record<string, WhatsAppAccountConfig>;
|
accounts?: Record<string, WhatsAppAccountConfig>;
|
||||||
@@ -73,29 +94,9 @@ export type WhatsAppConfig = {
|
|||||||
blockStreamingCoalesce?: BlockStreamingCoalesceConfig;
|
blockStreamingCoalesce?: BlockStreamingCoalesceConfig;
|
||||||
/** Per-action tool gating (default: true for all). */
|
/** Per-action tool gating (default: true for all). */
|
||||||
actions?: WhatsAppActionConfig;
|
actions?: WhatsAppActionConfig;
|
||||||
groups?: Record<
|
groups?: Record<string, WhatsAppGroupConfig>;
|
||||||
string,
|
|
||||||
{
|
|
||||||
requireMention?: boolean;
|
|
||||||
tools?: GroupToolPolicyConfig;
|
|
||||||
toolsBySender?: GroupToolPolicyBySenderConfig;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
/** Acknowledgment reaction sent immediately upon message receipt. */
|
/** Acknowledgment reaction sent immediately upon message receipt. */
|
||||||
ackReaction?: {
|
ackReaction?: WhatsAppAckReactionConfig;
|
||||||
/** Emoji to use for acknowledgment (e.g., "👀"). Empty = disabled. */
|
|
||||||
emoji?: string;
|
|
||||||
/** Send reactions in direct chats. Default: true. */
|
|
||||||
direct?: boolean;
|
|
||||||
/**
|
|
||||||
* Send reactions in group chats:
|
|
||||||
* - "always": react to all group messages
|
|
||||||
* - "mentions": react only when bot is mentioned
|
|
||||||
* - "never": never react in groups
|
|
||||||
* Default: "mentions"
|
|
||||||
*/
|
|
||||||
group?: "always" | "mentions" | "never";
|
|
||||||
};
|
|
||||||
/** Debounce window (ms) for batching rapid consecutive messages from the same sender (0 to disable). */
|
/** Debounce window (ms) for batching rapid consecutive messages from the same sender (0 to disable). */
|
||||||
debounceMs?: number;
|
debounceMs?: number;
|
||||||
/** Heartbeat visibility settings for this channel. */
|
/** Heartbeat visibility settings for this channel. */
|
||||||
@@ -141,29 +142,9 @@ export type WhatsAppAccountConfig = {
|
|||||||
blockStreaming?: boolean;
|
blockStreaming?: boolean;
|
||||||
/** Merge streamed block replies before sending. */
|
/** Merge streamed block replies before sending. */
|
||||||
blockStreamingCoalesce?: BlockStreamingCoalesceConfig;
|
blockStreamingCoalesce?: BlockStreamingCoalesceConfig;
|
||||||
groups?: Record<
|
groups?: Record<string, WhatsAppGroupConfig>;
|
||||||
string,
|
|
||||||
{
|
|
||||||
requireMention?: boolean;
|
|
||||||
tools?: GroupToolPolicyConfig;
|
|
||||||
toolsBySender?: GroupToolPolicyBySenderConfig;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
/** Acknowledgment reaction sent immediately upon message receipt. */
|
/** Acknowledgment reaction sent immediately upon message receipt. */
|
||||||
ackReaction?: {
|
ackReaction?: WhatsAppAckReactionConfig;
|
||||||
/** Emoji to use for acknowledgment (e.g., "👀"). Empty = disabled. */
|
|
||||||
emoji?: string;
|
|
||||||
/** Send reactions in direct chats. Default: true. */
|
|
||||||
direct?: boolean;
|
|
||||||
/**
|
|
||||||
* Send reactions in group chats:
|
|
||||||
* - "always": react to all group messages
|
|
||||||
* - "mentions": react only when bot is mentioned
|
|
||||||
* - "never": never react in groups
|
|
||||||
* Default: "mentions"
|
|
||||||
*/
|
|
||||||
group?: "always" | "mentions" | "never";
|
|
||||||
};
|
|
||||||
/** Debounce window (ms) for batching rapid consecutive messages from the same sender (0 to disable). */
|
/** Debounce window (ms) for batching rapid consecutive messages from the same sender (0 to disable). */
|
||||||
debounceMs?: number;
|
debounceMs?: number;
|
||||||
/** Heartbeat visibility settings for this account. */
|
/** Heartbeat visibility settings for this account. */
|
||||||
|
|||||||
Reference in New Issue
Block a user