refactor: trim discord helper exports · openclaw/openclaw@7e06455
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -160,7 +160,7 @@ function resolveDiscordAccountTokenOwner(params: {
|
160 | 160 | return owner?.accountId; |
161 | 161 | } |
162 | 162 | |
163 | | -export function resolveDiscordDuplicateTokenOwner(params: { |
| 163 | +function resolveDiscordDuplicateTokenOwner(params: { |
164 | 164 | cfg: OpenClawConfig; |
165 | 165 | account: ResolvedDiscordAccount; |
166 | 166 | }): string | undefined { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -121,7 +121,7 @@ function getDiscordApiRetryAfterMs(
|
121 | 121 | return Math.min(Math.max(0, err.retryAfter * 1000), retryConfig.maxDelayMs); |
122 | 122 | } |
123 | 123 | |
124 | | -export type DiscordFetchOptions = { |
| 124 | +type DiscordFetchOptions = { |
125 | 125 | retry?: RetryConfig; |
126 | 126 | label?: string; |
127 | 127 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -160,7 +160,7 @@ function createDiscordApproverDmTargetResolver(configOverride?: DiscordExecAppro
|
160 | 160 | }); |
161 | 161 | } |
162 | 162 | |
163 | | -export function createDiscordApprovalCapability(configOverride?: DiscordExecApprovalConfig | null) { |
| 163 | +function createDiscordApprovalCapability(configOverride?: DiscordExecApprovalConfig | null) { |
164 | 164 | return createApproverRestrictedNativeApprovalCapability({ |
165 | 165 | channel: "discord", |
166 | 166 | channelLabel: "Discord", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ import type {
|
6 | 6 | import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; |
7 | 7 | import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; |
8 | 8 | |
9 | | -export type DiscordChannelPermissionsAuditEntry = { |
| 9 | +type DiscordChannelPermissionsAuditEntry = { |
10 | 10 | channelId: string; |
11 | 11 | ok: boolean; |
12 | 12 | missing?: string[]; |
@@ -35,7 +35,7 @@ function shouldAuditChannelConfig(config: DiscordGuildChannelConfig | undefined)
|
35 | 35 | return true; |
36 | 36 | } |
37 | 37 | |
38 | | -export function listConfiguredGuildChannelKeys( |
| 38 | +function listConfiguredGuildChannelKeys( |
39 | 39 | guilds: Record<string, DiscordGuildEntry> | undefined, |
40 | 40 | ): string[] { |
41 | 41 | if (!guilds) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { chunkMarkdownTextWithMode, type ChunkMode } from "openclaw/plugin-sdk/reply-chunking"; |
2 | 2 | |
3 | | -export type ChunkDiscordTextOpts = { |
| 3 | +type ChunkDiscordTextOpts = { |
4 | 4 | /** Max characters per Discord message. Default: 2000. */ |
5 | 5 | maxChars?: number; |
6 | 6 | /** |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,7 @@ const DISCORD_STREAM_MAX_CHARS = 2000;
|
12 | 12 | const DEFAULT_THROTTLE_MS = 1200; |
13 | 13 | const DISCORD_PREVIEW_ALLOWED_MENTIONS = { parse: [] }; |
14 | 14 | |
15 | | -export type DiscordDraftStream = { |
| 15 | +type DiscordDraftStream = { |
16 | 16 | update: (text: string) => void; |
17 | 17 | flush: () => Promise<void>; |
18 | 18 | messageId: () => string | undefined; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,7 @@ export type DiscordInteractiveHandlerRegistration = PluginInteractiveRegistratio
|
51 | 51 | "discord" |
52 | 52 | >; |
53 | 53 | |
54 | | -export type DiscordInteractiveDispatchContext = Omit< |
| 54 | +type DiscordInteractiveDispatchContext = Omit< |
55 | 55 | DiscordInteractiveHandlerContext, |
56 | 56 | | "interaction" |
57 | 57 | | "respond" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,7 @@ type DiscordSendRuntime = typeof import("./send.js");
|
11 | 11 | |
12 | 12 | export type DiscordSendFn = DiscordSendRuntime["sendMessageDiscord"]; |
13 | 13 | export type DiscordVoiceSendFn = DiscordSendRuntime["sendVoiceMessageDiscord"]; |
14 | | -export type DiscordFormattingOptions = { |
| 14 | +type DiscordFormattingOptions = { |
15 | 15 | textLimit?: number; |
16 | 16 | maxLinesPerMessage?: number; |
17 | 17 | tableMode?: NonNullable<Parameters<DiscordSendFn>[2]>["tableMode"]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export type DiscordPreviewStreamMode = "off" | "partial" | "block"; |
| 1 | +type DiscordPreviewStreamMode = "off" | "partial" | "block"; |
2 | 2 | |
3 | 3 | function parsePreviewStreamingMode(value: unknown): DiscordPreviewStreamMode | undefined { |
4 | 4 | return value === "off" || value === "partial" || value === "block" ? value : undefined; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
|
6 | 6 | import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; |
7 | 7 | import type { ResolvedDiscordAccount } from "./accounts.js"; |
8 | 8 | |
9 | | -export function resolveDiscordProxyUrl( |
| 9 | +function resolveDiscordProxyUrl( |
10 | 10 | account: Pick<ResolvedDiscordAccount, "config">, |
11 | 11 | cfg: OpenClawConfig, |
12 | 12 | ): string | undefined { |
@@ -22,7 +22,7 @@ export function resolveDiscordProxyUrl(
|
22 | 22 | return trimmed || undefined; |
23 | 23 | } |
24 | 24 | |
25 | | -export function resolveDiscordProxyFetchByUrl( |
| 25 | +function resolveDiscordProxyFetchByUrl( |
26 | 26 | proxyUrl: string | undefined, |
27 | 27 | runtime?: Pick<RuntimeEnv, "error">, |
28 | 28 | ): typeof fetch | undefined { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。