docs: generalize core channel examples · openclaw/openclaw@b70531b
steipete
·
2026-04-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ import { readStringParam } from "./common.js";
|
10 | 10 | const TtsToolSchema = Type.Object({ |
11 | 11 | text: Type.String({ description: "Text to convert to speech." }), |
12 | 12 | channel: Type.Optional( |
13 | | -Type.String({ description: "Optional channel id to pick output format (e.g. telegram)." }), |
| 13 | +Type.String({ description: "Optional channel id to pick output format." }), |
14 | 14 | ), |
15 | 15 | }); |
16 | 16 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,7 +58,7 @@ export type MessageReceivedHookContext = {
|
58 | 58 | content: string; |
59 | 59 | /** Unix timestamp when the message was received */ |
60 | 60 | timestamp?: number; |
61 | | -/** Channel identifier (e.g., "telegram", "whatsapp") */ |
| 61 | +/** Channel identifier (for example "chat" or "support-chat") */ |
62 | 62 | channelId: string; |
63 | 63 | /** Provider account ID for multi-account setups */ |
64 | 64 | accountId?: string; |
@@ -85,7 +85,7 @@ export type MessageSentHookContext = {
|
85 | 85 | success: boolean; |
86 | 86 | /** Error message if sending failed */ |
87 | 87 | error?: string; |
88 | | -/** Channel identifier (e.g., "telegram", "whatsapp") */ |
| 88 | +/** Channel identifier (for example "chat" or "support-chat") */ |
89 | 89 | channelId: string; |
90 | 90 | /** Provider account ID for multi-account setups */ |
91 | 91 | accountId?: string; |
@@ -116,7 +116,7 @@ type MessageEnrichedBodyHookContext = {
|
116 | 116 | bodyForAgent?: string; |
117 | 117 | /** Unix timestamp when the message was received */ |
118 | 118 | timestamp?: number; |
119 | | -/** Channel identifier (e.g., "telegram", "whatsapp") */ |
| 119 | +/** Channel identifier (for example "chat" or "support-chat") */ |
120 | 120 | channelId: string; |
121 | 121 | /** Conversation/chat ID */ |
122 | 122 | conversationId?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -177,7 +177,7 @@ async function assertExplicitProxyAllowed(
|
177 | 177 | // The proxy hostname is operator-configured, not user input. |
178 | 178 | // Clear the target-scoped hostnameAllowlist so configured proxies |
179 | 179 | // like localhost or internal hosts aren't rejected by an allowlist |
180 | | -// that was built for the target URL (e.g. api.telegram.org). |
| 180 | +// that was built for the target URL (for example api.example.test). |
181 | 181 | // Private-network IP checks still apply via allowPrivateNetwork. |
182 | 182 | ...policy, |
183 | 183 | allowPrivateNetwork: true, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -54,7 +54,7 @@ describe("redactSensitiveText", () => {
|
54 | 54 | expect(output).toBe("Authorization: Bearer abcdef…ghij"); |
55 | 55 | }); |
56 | 56 | |
57 | | -it("masks Telegram-style tokens", () => { |
| 57 | +it("masks bot-style tokens", () => { |
58 | 58 | const input = "123456:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"; |
59 | 59 | const output = redactSensitiveText(input, { |
60 | 60 | mode: "tools", |
@@ -63,14 +63,14 @@ describe("redactSensitiveText", () => {
|
63 | 63 | expect(output).toBe("123456…cdef"); |
64 | 64 | }); |
65 | 65 | |
66 | | -it("masks Telegram Bot API URL tokens", () => { |
| 66 | +it("masks bot API URL tokens", () => { |
67 | 67 | const input = |
68 | | -"GET https://api.telegram.org/bot123456:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef/getMe HTTP/1.1"; |
| 68 | +"GET https://api.example.test/bot123456:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef/getMe HTTP/1.1"; |
69 | 69 | const output = redactSensitiveText(input, { |
70 | 70 | mode: "tools", |
71 | 71 | patterns: defaults, |
72 | 72 | }); |
73 | | -expect(output).toBe("GET https://api.telegram.org/bot123456…cdef/getMe HTTP/1.1"); |
| 73 | +expect(output).toBe("GET https://api.example.test/bot123456…cdef/getMe HTTP/1.1"); |
74 | 74 | }); |
75 | 75 | |
76 | 76 | it("redacts short tokens fully", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1675,11 +1675,11 @@ export type OpenClawPluginGatewayMethod = {
|
1675 | 1675 | * Context passed to plugin command handlers. |
1676 | 1676 | */ |
1677 | 1677 | export type PluginCommandContext = { |
1678 | | -/** The sender's identifier (e.g., Telegram user ID) */ |
| 1678 | +/** The sender's identifier (for example a channel-scoped user ID) */ |
1679 | 1679 | senderId?: string; |
1680 | | -/** The channel/surface (e.g., "telegram", "discord") */ |
| 1680 | +/** The channel/surface (for example "chat" or "team-chat") */ |
1681 | 1681 | channel: string; |
1682 | | -/** Provider channel id (e.g., "telegram") */ |
| 1682 | +/** Provider channel id */ |
1683 | 1683 | channelId?: ChannelId; |
1684 | 1684 | /** Whether the sender is on the allowlist */ |
1685 | 1685 | isAuthorizedSender: boolean; |
@@ -1735,7 +1735,7 @@ export type OpenClawPluginCommandDefinition = {
|
1735 | 1735 | /** |
1736 | 1736 | * Optional native-command aliases for slash/menu surfaces. |
1737 | 1737 | * `default` applies to all native providers unless a provider-specific |
1738 | | - * override exists (for example `{ default: "talkvoice", discord: "voice2" }`). |
| 1738 | + * override exists (for example `{ default: "talkvoice", teamChat: "voice2" }`). |
1739 | 1739 | */ |
1740 | 1740 | nativeNames?: Partial<Record<string, string>> & { default?: string }; |
1741 | 1741 | /** |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。