@openclaw/discord 2026.8.33 → 2026.8.35

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 (66) hide show
  1. package/dist/.setup/{activities-api-C-Bsnq1G.mjs → activities-api-BwQKkvff.mjs} +4 -4
  2. package/dist/.setup/{api-BPmtSfv2.mjs → api-kTDbK4de.mjs} +1 -1
  3. package/dist/.setup/{approval-handler.runtime-Bs_TXgLF.mjs → approval-handler.runtime-BDfIYRq2.mjs} +16 -10
  4. package/dist/.setup/{audit-ZQTgYzB4.mjs → audit-CKa5IoCq.mjs} +4 -4
  5. package/dist/.setup/{channel-DF2ExUs2.mjs → channel-CZSRIHJh.mjs} +21 -17
  6. package/dist/.setup/{channel-actions.runtime-jRU56t8E.mjs → channel-actions.runtime-BN2Bo6so.mjs} +7 -7
  7. package/dist/.setup/{retry-after-BrLjLUJi.mjs → channel-type-CGDUPxwc.mjs} +7 -1
  8. package/dist/.setup/{channel.setup-0Wxa3OWc.mjs → channel.setup-Bur0l9L5.mjs} +3 -3
  9. package/dist/.setup/{components-CEeBxgcs.mjs → components-CoCQebYz.mjs} +3 -3
  10. package/dist/.setup/{conversation-binding-route-B9XcnpJU.mjs → conversation-binding-route-lGfxhTC8.mjs} +1 -1
  11. package/dist/.setup/{directory-config-Dc3B-ZMl.mjs → directory-config-DCfqBbC0.mjs} +1 -1
  12. package/dist/.setup/{directory-live-N2I3Zs-M.mjs → directory-live-D12MauCI.mjs} +2 -2
  13. package/dist/.setup/{doctor-BHWMlh0v.mjs → doctor-BFwyA5iJ.mjs} +2 -2
  14. package/dist/.setup/{handle-action.guild-admin-Da1BoWav.mjs → handle-action.guild-admin-DlRmtY7d.mjs} +2 -2
  15. package/dist/.setup/{message-handler-BUf5UZ99.mjs → message-handler-csC1_h15.mjs} +6 -11
  16. package/dist/.setup/{message-handler.preflight-D1Gr8s9O.mjs → message-handler.preflight-D6m727PE.mjs} +11 -11
  17. package/dist/.setup/{message-handler.process-B4cKeEIn.mjs → message-handler.process-CDCvR5h9.mjs} +18 -12
  18. package/dist/.setup/{message-text-DSUwjMvz.mjs → message-text-D1pWUazL.mjs} +1 -1
  19. package/dist/.setup/{outbound-adapter-Bt2FeOIt.mjs → outbound-adapter-Chm8qvn4.mjs} +17 -8
  20. package/dist/.setup/{outbound-components-BfHsZg_Z.mjs → outbound-components-BBZ6nUHC.mjs} +3 -3
  21. package/dist/.setup/{outbound-session-route-CbGbV68Y.mjs → outbound-session-route-0ulhwPFj.mjs} +6 -3
  22. package/dist/.setup/{pluralkit-CypgBmxZ.mjs → pluralkit-CqssqANl.mjs} +1 -1
  23. package/dist/.setup/{probe-nNUYDl3D.mjs → probe-C-h4at-8.mjs} +1 -1
  24. package/dist/.setup/{probe.runtime-E8rurbhe.mjs → probe.runtime-Bo5mMeDP.mjs} +1 -1
  25. package/dist/.setup/{provider-Doz9PQWC.mjs → provider-Ba4-fuFV.mjs} +22 -22
  26. package/dist/.setup/{provider-session.runtime-CKfWV4ar.mjs → provider-session.runtime-BpjJX34f.mjs} +3 -3
  27. package/dist/.setup/provider.runtime-CKbLUNMq.mjs +2 -0
  28. package/dist/.setup/{realtime-session.runtime-Daa6MqqD.mjs → realtime-session.runtime-CNbzjoNe.mjs} +1 -1
  29. package/dist/.setup/{resolve-allowlist-common-BxhPJmek.mjs → resolve-allowlist-common-DSui4O22.mjs} +1 -1
  30. package/dist/.setup/{resolve-channels-Dzpy_xQQ.mjs → resolve-channels-BKEOjdaq.mjs} +4 -4
  31. package/dist/.setup/{resolve-users-CuMowsQo.mjs → resolve-users-4wQGN81h.mjs} +3 -3
  32. package/dist/.setup/{retry-B_XP5NOZ.mjs → retry-BtpfSmcV.mjs} +2 -2
  33. package/dist/.setup/{runtime-BfZLEPgp.mjs → runtime-BYnanhCN.mjs} +8 -8
  34. package/dist/.setup/{runtime-DpP83aPR.mjs → runtime-CF--tPzY.mjs} +1 -1
  35. package/dist/.setup/{send-CymvczbX.mjs → send-jx1xq6VI.mjs} +63 -50
  36. package/dist/.setup/{send.components-CYpxNGMy.mjs → send.components-C85HkVgh.mjs} +4 -4
  37. package/dist/.setup/{send.outbound-DR2oYnMr.mjs → send.outbound-Cne1E1Ys.mjs} +3 -3
  38. package/dist/.setup/{send.shared-3gLZcqCz.mjs → send.shared-BljlFDUk.mjs} +12 -9
  39. package/dist/.setup/setup-plugin-api-CbpX72Q5.mjs +3 -0
  40. package/dist/.setup/{shared-BatfFi3a.mjs → shared-DZqXK-Da.mjs} +1 -1
  41. package/dist/.setup/{subagent-hooks-D78_6mH2.mjs → subagent-hooks-CIfMjUwr.mjs} +2 -2
  42. package/dist/.setup/{system-events-CpvWZtoY.mjs → system-events-CLIJ2rLL.mjs} +1 -1
  43. package/dist/.setup/{target-resolver-C1JWPpuA.mjs → target-resolver-8yRFu_yi.mjs} +2 -2
  44. package/dist/.setup/targets-ueZDqOW4.mjs +3 -0
  45. package/dist/.setup/{thread-bindings-DB2lxpj7.mjs → thread-bindings-W-yX7LUM.mjs} +3 -3
  46. package/dist/.setup/{thread-bindings.manager-BgOMPrjG.mjs → thread-bindings.manager-DWsWOJ_n.mjs} +5 -5
  47. package/dist/.setup/{threading-GYQaIegI.mjs → threading-BF7weZ9x.mjs} +4 -4
  48. package/dist/.setup/{transcripts-source-Cd4F1k_2.mjs → transcripts-source-Cdn3N3o6.mjs} +1 -1
  49. package/dist/.setup/{typing-Br2kUYWE.mjs → typing--DRxDu9D.mjs} +1 -1
  50. package/dist/.setup/{voice-runtime-Ca2A-GG0.mjs → voice-runtime-DeuqoHm9.mjs} +4 -4
  51. package/dist/action-runtime-api.js +1 -1
  52. package/dist/activities-api.js +1 -1
  53. package/dist/api.js +14 -14
  54. package/dist/channel-plugin-api.js +1 -1
  55. package/dist/directory-contract-api.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/runtime-api.js +16 -16
  58. package/dist/setup-entry.js +1 -1
  59. package/dist/setup-plugin-api.js +1 -1
  60. package/dist/subagent-hooks-api.js +1 -1
  61. package/dist/transcripts-source-api.js +1 -1
  62. package/package.json +4 -4
  63. package/dist/.setup/channel-type-CVLZyGYS.mjs +0 -7
  64. package/dist/.setup/provider.runtime-D3LY9lWO.mjs +0 -2
  65. package/dist/.setup/setup-plugin-api-FH_1XPpk.mjs +0 -3
  66. package/dist/.setup/targets-BdyllneU.mjs +0 -3
@@ -1,4 +1,4 @@
1
- import { on as __exportAll } from "./retry-B_XP5NOZ.mjs";
1
+ import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
2
2
  import { readProviderJsonObjectResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
3
3
  import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
4
4
  import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
@@ -1,5 +1,5 @@
1
1
  import { m as normalizeDiscordToken } from "./accounts-CwJQoLjM.mjs";
2
- import { n as DiscordApiError, r as fetchDiscord } from "./api-BPmtSfv2.mjs";
2
+ import { n as DiscordApiError, r as fetchDiscord } from "./api-kTDbK4de.mjs";
3
3
  import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
5
5
  import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
@@ -1,2 +1,2 @@
1
- import { a as probeDiscordApplicationId, i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-nNUYDl3D.mjs";
1
+ import { a as probeDiscordApplicationId, i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-C-h4at-8.mjs";
2
2
  export { fetchDiscordApplicationId, fetchDiscordApplicationSummary, parseApplicationIdFromToken, probeDiscord, probeDiscordApplicationId, resolveDiscordPrivilegedIntentsFromFlags };
@@ -1,27 +1,27 @@
1
- import { A as ThreadUpdateListener, C as MessageCreateListener, D as ReadyListener, E as PresenceUpdateListener, G as User, H as CommandWithSubcommands, I as RateLimitError, K as hasDiscordV2Components, M as Client, N as Plugin, S as InteractionCreateListener, T as MessageReactionRemoveListener, U as Guild, V as Command, W as Message, Z as Modal, a as chunkDiscordTextWithMode, b as GuildCreateListener, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, ht as BaseMessageInteractiveComponent, k as ThreadDeleteListener, nt as Container, ut as Separator, w as MessageReactionAddListener, x as GuildDeleteListener, y as discord_exports } from "./retry-B_XP5NOZ.mjs";
2
- import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-CEeBxgcs.mjs";
1
+ import { A as ThreadUpdateListener, C as MessageCreateListener, D as ReadyListener, E as PresenceUpdateListener, G as User, H as CommandWithSubcommands, I as RateLimitError, K as hasDiscordV2Components, M as Client, N as Plugin, S as InteractionCreateListener, T as MessageReactionRemoveListener, U as Guild, V as Command, W as Message, Z as Modal, a as chunkDiscordTextWithMode, b as GuildCreateListener, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, ht as BaseMessageInteractiveComponent, k as ThreadDeleteListener, nt as Container, ut as Separator, w as MessageReactionAddListener, x as GuildDeleteListener, y as discord_exports } from "./retry-BtpfSmcV.mjs";
2
+ import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-CoCQebYz.mjs";
3
+ import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
3
4
  import { c as resolveDiscordAccount, f as resolveDiscordAccountDmPolicy, l as resolveDiscordAccountAllowFrom, m as normalizeDiscordToken, p as resolveDiscordMaxLinesPerMessage } from "./accounts-CwJQoLjM.mjs";
4
- import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-CYpxNGMy.mjs";
5
+ import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-C85HkVgh.mjs";
5
6
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
6
- import { a as isDiscordRateLimitResponseBody, o as summarizeDiscordResponseBody } from "./api-BPmtSfv2.mjs";
7
+ import { a as isDiscordRateLimitResponseBody, o as summarizeDiscordResponseBody } from "./api-kTDbK4de.mjs";
7
8
  import { C as resolveTimestampMs, a as normalizeDiscordSlug, b as formatDiscordReactionEmoji, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordCommandOwnerAllowFrom, f as resolveDiscordGuildEntry, g as resolveDiscordOwnerAllowFrom, h as resolveDiscordOwnerAccess, i as normalizeDiscordDisplaySlug, l as resolveDiscordChannelPolicyCommandAuthorizer, m as resolveDiscordMemberAllowed, n as isDiscordGroupAllowedByPolicy, o as resolveDiscordAllowListMatch, p as resolveDiscordMemberAccessState, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, v as resolveGroupDmAllow, x as formatDiscordUserTag, y as shouldEmitDiscordReactionNotification } from "./allow-list-C2JuH-R0.mjs";
8
- import { B as validateDiscordProxyUrl, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, b as canViewDiscordGuildChannel, w as hasAnyChannelPermissionDiscord } from "./send.shared-3gLZcqCz.mjs";
9
- import { a as formatMention, t as sendMessageDiscord } from "./send.outbound-DR2oYnMr.mjs";
10
- import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.mjs";
11
- import { n as getDiscordActivitiesRuntime } from "./runtime-DpP83aPR.mjs";
9
+ import { B as validateDiscordProxyUrl, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, b as canViewDiscordGuildChannel, w as hasAnyChannelPermissionDiscord } from "./send.shared-BljlFDUk.mjs";
10
+ import { a as formatMention, t as sendMessageDiscord } from "./send.outbound-Cne1E1Ys.mjs";
11
+ import { n as getDiscordActivitiesRuntime } from "./runtime-CF--tPzY.mjs";
12
12
  import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-B7G6o_bq.mjs";
13
13
  import { i as setPresence, t as clearPresences } from "./presence-cache-z1N8MbJ3.mjs";
14
- import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-CymvczbX.mjs";
14
+ import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-jx1xq6VI.mjs";
15
15
  import { c as raceWithTimeout, u as withAbortTimeout } from "./timeouts-D86uWLt_.mjs";
16
- import { S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, c as resolveDiscordEffectiveRoute, i as buildDiscordConversationRouteContext, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, o as resolveDiscordBoundConversationRoute, r as formatDiscordApprovalDisplayValue, u as resolveDiscordConversationIdentity } from "./outbound-session-route-CbGbV68Y.mjs";
16
+ import { S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, c as resolveDiscordEffectiveRoute, i as buildDiscordConversationRouteContext, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, o as resolveDiscordBoundConversationRoute, r as formatDiscordApprovalDisplayValue, u as resolveDiscordConversationIdentity } from "./outbound-session-route-0ulhwPFj.mjs";
17
17
  import { t as discordIngressIdentity } from "./ingress-identity-BwX7d_Gh.mjs";
18
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-Dzpy_xQQ.mjs";
19
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-CuMowsQo.mjs";
20
- import { a as isThreadArchived, c as resolveDiscordChannelInfoSafe, f as resolveDiscordChannelTopicSafe, h as formatThreadBindingDurationLabel, l as resolveDiscordChannelNameSafe, r as getThreadBindingManager, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-BgOMPrjG.mjs";
21
- import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-nNUYDl3D.mjs";
18
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BKEOjdaq.mjs";
19
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-4wQGN81h.mjs";
20
+ import { a as isThreadArchived, c as resolveDiscordChannelInfoSafe, f as resolveDiscordChannelTopicSafe, h as formatThreadBindingDurationLabel, l as resolveDiscordChannelNameSafe, r as getThreadBindingManager, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-DWsWOJ_n.mjs";
21
+ import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-C-h4at-8.mjs";
22
22
  import { i as sanitizeRecentModels, n as normalizeModelRef, r as preferenceTimestampMs, t as buildPreferenceModelKey } from "./model-picker-preference-primitives-BHT1LkR_.mjs";
23
- import { m as resolveDiscordChannelInfo, u as resolveDiscordMessageStickers } from "./message-text-DSUwjMvz.mjs";
24
- import { i as resolveDiscordThreadParentInfo } from "./threading-GYQaIegI.mjs";
23
+ import { m as resolveDiscordChannelInfo, u as resolveDiscordMessageStickers } from "./message-text-D1pWUazL.mjs";
24
+ import { i as resolveDiscordThreadParentInfo } from "./threading-BF7weZ9x.mjs";
25
25
  import { t as resolveDiscordSenderIdentity } from "./sender-identity-DirkiBy8.mjs";
26
26
  import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
27
27
  import { ApplicationCommandOptionType, ButtonStyle, ChannelType, ComponentType, GatewayCloseCodes, GatewayCloseCodes as GatewayCloseCodes$1, GatewayDispatchEvents, GatewayIntentBits, GatewayOpcodes, PermissionFlagsBits } from "discord-api-types/v10";
@@ -6500,7 +6500,7 @@ async function runDiscordGatewayLifecycle(params) {
6500
6500
  gatewayEmitter?.removeListener(DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT, onGatewayTransportActivity);
6501
6501
  if (params.voiceManager) {
6502
6502
  await params.voiceManager.destroy();
6503
- const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-Cd4F1k_2.mjs").then((n) => n.n);
6503
+ const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-Cdn3N3o6.mjs").then((n) => n.n);
6504
6504
  setDiscordTranscriptsVoiceManager({
6505
6505
  accountId: params.accountId,
6506
6506
  manager: null
@@ -6515,7 +6515,7 @@ async function runDiscordGatewayLifecycle(params) {
6515
6515
  let discordVoiceRuntimePromise;
6516
6516
  let discordProviderSessionRuntimePromise;
6517
6517
  async function loadDiscordVoiceRuntime() {
6518
- const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-Ca2A-GG0.mjs").then((n) => n.t);
6518
+ const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-DeuqoHm9.mjs").then((n) => n.t);
6519
6519
  discordVoiceRuntimePromise = promise;
6520
6520
  try {
6521
6521
  return await promise;
@@ -6525,7 +6525,7 @@ async function loadDiscordVoiceRuntime() {
6525
6525
  }
6526
6526
  }
6527
6527
  async function loadDiscordProviderSessionRuntime() {
6528
- const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-CKfWV4ar.mjs");
6528
+ const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-BpjJX34f.mjs");
6529
6529
  discordProviderSessionRuntimePromise = promise;
6530
6530
  try {
6531
6531
  return await promise;
@@ -8342,7 +8342,7 @@ async function deliverDiscordReply(params) {
8342
8342
  //#endregion
8343
8343
  //#region extensions/discord/src/monitor/agent-components.dispatch.ts
8344
8344
  const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("./agent-components.runtime-CEPrf2SY.mjs"));
8345
- const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-Br2kUYWE.mjs").then((n) => n.n));
8345
+ const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing--DRxDu9D.mjs").then((n) => n.n));
8346
8346
  function buildDiscordComponentConversationLabel(params) {
8347
8347
  if (params.interactionCtx.isDirectMessage) return buildDirectLabel(params.interactionCtx.user);
8348
8348
  if (params.interactionCtx.isGroupDm) return `Group DM #${params.channelCtx.channelName ?? params.interactionCtx.channelId} channel id:${params.interactionCtx.channelId}`;
@@ -8749,7 +8749,7 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
8749
8749
  }
8750
8750
  //#endregion
8751
8751
  //#region extensions/discord/src/monitor/agent-components.handlers.ts
8752
- const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-CEeBxgcs.mjs").then((n) => n.t));
8752
+ const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-CoCQebYz.mjs").then((n) => n.t));
8753
8753
  async function handleDiscordComponentEvent(params) {
8754
8754
  const parsed = parseDiscordComponentData(params.data, resolveInteractionCustomId(params.interaction));
8755
8755
  if (!parsed) {
@@ -10292,7 +10292,7 @@ async function monitorDiscordProvider(opts = {}) {
10292
10292
  runtime,
10293
10293
  botUserId
10294
10294
  });
10295
- const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-Cd4F1k_2.mjs").then((n) => n.n);
10295
+ const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-Cdn3N3o6.mjs").then((n) => n.n);
10296
10296
  setDiscordTranscriptsVoiceManager({
10297
10297
  accountId: account.accountId,
10298
10298
  manager: voiceManager
@@ -1,6 +1,6 @@
1
- import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-BgOMPrjG.mjs";
2
- import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-DB2lxpj7.mjs";
3
- import { t as createDiscordMessageHandler } from "./message-handler-BUf5UZ99.mjs";
1
+ import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-DWsWOJ_n.mjs";
2
+ import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-W-yX7LUM.mjs";
3
+ import { t as createDiscordMessageHandler } from "./message-handler-csC1_h15.mjs";
4
4
  import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
5
5
  import { getAcpSessionManager, isAcpRuntimeError } from "openclaw/plugin-sdk/acp-runtime";
6
6
  export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled };
@@ -0,0 +1,2 @@
1
+ import { t as monitorDiscordProvider } from "./provider-Ba4-fuFV.mjs";
2
+ export { monitorDiscordProvider };
@@ -1,5 +1,5 @@
1
1
  import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-DFu9hfU8.mjs";
2
- import { a as createDiscordOpusEncodeStream, c as formatVoiceLogPreview, i as convertRealtimePcm24kMonoToDiscordPcm48kStereo, l as loadDiscordVoiceSdk, n as logVoiceVerbose, o as formatVoiceIngressPrompt, r as convertDiscordPcm48kStereoToRealtimePcm24kMono, s as maybeControlDiscordVoiceAgentRun } from "./voice-runtime-Ca2A-GG0.mjs";
2
+ import { a as createDiscordOpusEncodeStream, c as formatVoiceLogPreview, i as convertRealtimePcm24kMonoToDiscordPcm48kStereo, l as loadDiscordVoiceSdk, n as logVoiceVerbose, o as formatVoiceIngressPrompt, r as convertDiscordPcm48kStereoToRealtimePcm24kMono, s as maybeControlDiscordVoiceAgentRun } from "./voice-runtime-DeuqoHm9.mjs";
3
3
  import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
5
5
  import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
@@ -1,5 +1,5 @@
1
1
  import { m as normalizeDiscordToken } from "./accounts-CwJQoLjM.mjs";
2
- import { r as fetchDiscord } from "./api-BPmtSfv2.mjs";
2
+ import { r as fetchDiscord } from "./api-kTDbK4de.mjs";
3
3
  import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.mjs";
4
4
  //#region extensions/discord/src/guilds.ts
5
5
  async function listGuilds(token, fetcher, options) {
@@ -1,8 +1,8 @@
1
- import { on as __exportAll } from "./retry-B_XP5NOZ.mjs";
2
- import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BPmtSfv2.mjs";
1
+ import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
2
+ import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
3
+ import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-kTDbK4de.mjs";
3
4
  import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.mjs";
4
- import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.mjs";
5
- import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BxhPJmek.mjs";
5
+ import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-DSui4O22.mjs";
6
6
  //#region extensions/discord/src/resolve-channels.ts
7
7
  var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
8
8
  function parseDiscordChannelInput(raw) {
@@ -1,6 +1,6 @@
1
- import { on as __exportAll } from "./retry-B_XP5NOZ.mjs";
2
- import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BPmtSfv2.mjs";
3
- import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BxhPJmek.mjs";
1
+ import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
2
+ import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-kTDbK4de.mjs";
3
+ import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-DSui4O22.mjs";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/discord/src/resolve-users.ts
6
6
  var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveDiscordUserAllowlist: () => resolveDiscordUserAllowlist });
@@ -1,4 +1,4 @@
1
- import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-BrLjLUJi.mjs";
1
+ import { n as parseDiscordRetryAfterBodySeconds } from "./channel-type-CGDUPxwc.mjs";
2
2
  import "node:module";
3
3
  import { redactIdentifier, redactSensitiveFieldValue } from "openclaw/plugin-sdk/logging-core";
4
4
  import { ApplicationCommandOptionType, ApplicationCommandType, ButtonStyle, ComponentType, GatewayDispatchEvents, InteractionContextType, InteractionResponseType, InteractionType, MessageFlags, Routes, TextInputStyle } from "discord-api-types/v10";
@@ -3209,7 +3209,7 @@ function looksLikeDiscordTargetId(raw) {
3209
3209
  //#region extensions/discord/src/reply-reference.ts
3210
3210
  function resolveDiscordReplyReference(params) {
3211
3211
  if (!params.replyToId) return;
3212
- const singleUse = params.replyToIdSource !== "explicit" && params.replyToMode !== void 0 && isSingleUseReplyToMode(params.replyToMode);
3212
+ const singleUse = params.replyToIdSource !== "explicit" && (params.replyToMode !== void 0 ? isSingleUseReplyToMode(params.replyToMode) : params.replyToIdSource === "implicit");
3213
3213
  return {
3214
3214
  messageId: params.replyToId,
3215
3215
  scope: singleUse ? "first" : "all"
@@ -1,14 +1,14 @@
1
- import { f as resolveDiscordReplyReference, u as createReusableDiscordReplyReference, v as resolveDiscordChannelId } from "./retry-B_XP5NOZ.mjs";
2
- import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-CEeBxgcs.mjs";
1
+ import { f as resolveDiscordReplyReference, u as createReusableDiscordReplyReference, v as resolveDiscordChannelId } from "./retry-BtpfSmcV.mjs";
2
+ import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-CoCQebYz.mjs";
3
+ import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
3
4
  import { o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-CwJQoLjM.mjs";
4
- import { r as sendDiscordComponentMessage } from "./send.components-CYpxNGMy.mjs";
5
+ import { r as sendDiscordComponentMessage } from "./send.components-C85HkVgh.mjs";
5
6
  import { a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, n as isDiscordGroupAllowedByPolicy, v as resolveGroupDmAllow } from "./allow-list-C2JuH-R0.mjs";
6
- import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-3gLZcqCz.mjs";
7
- import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DR2oYnMr.mjs";
8
- import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.mjs";
7
+ import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-BljlFDUk.mjs";
8
+ import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-Cne1E1Ys.mjs";
9
9
  import { n as getPresence } from "./presence-cache-z1N8MbJ3.mjs";
10
- import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-CymvczbX.mjs";
11
- import "./targets-BdyllneU.mjs";
10
+ import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-jx1xq6VI.mjs";
11
+ import "./targets-ueZDqOW4.mjs";
12
12
  import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
13
13
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
14
14
  import { asBoolean, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,5 +1,5 @@
1
1
  import { c as resolveDiscordAccount, g as selectDiscordActivitiesRuntimeConfig, n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds } from "./accounts-CwJQoLjM.mjs";
2
- import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-3gLZcqCz.mjs";
2
+ import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-BljlFDUk.mjs";
3
3
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/discord/src/activities/config.ts
5
5
  function resolveDiscordActivitiesConfig(account, env = process.env) {
@@ -1,7 +1,7 @@
1
- import { $t as listGuildRoles, At as getChannel, B as readRetryAfter, Bt as addGuildMemberRole, Ct as listMessageReactionUsers, Dt as deleteChannelMessage, Et as deleteChannel, F as DiscordError, Ft as listChannelPins, Gt as createGuildSticker, Ht as createGuildChannel, I as RateLimitError, It as pinChannelMessage, Jt as getGuildMember, Kt as deleteChannelPermission, L as isUnknownDiscordVoiceStateError, Lt as searchGuildMessages, Nt as listChannelArchivedThreads, Ot as editChannel, Pt as listChannelMessages, Qt as listGuildEmojis, R as readDiscordCode, Rt as sendChannelTyping, St as deleteOwnMessageReaction, Tt as createThread, Ut as createGuildEmoji, Vt as createGuildBan, Wt as createGuildScheduledEvent, Xt as listGuildActiveThreads, Yt as getGuildVoiceState, Zt as listGuildChannels, an as timeoutGuildMember, c as createDiscordSendResult, en as listGuildScheduledEvents, i as recordDiscordMessageCreateAmbiguity, in as removeGuildMemberRole, jt as getChannelMessage, kt as editChannelMessage, n as createDiscordRetryRunner, nn as putChannelPermission, on as __exportAll, qt as getGuild, rn as removeGuildMember, t as classifyDiscordDeliveryFailure, tn as moveGuildChannels, xt as createOwnMessageReaction, z as readDiscordMessage, zt as unpinChannelMessage } from "./retry-B_XP5NOZ.mjs";
2
- import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-BrLjLUJi.mjs";
3
- import { C as hasAllGuildPermissionsDiscord, I as resolveDiscordClientAccountContext, K as parseAndResolveChannelRecipient, L as resolveDiscordRest, M as resolveDiscordSuppressEmbeds, N as createDiscordClient, O as createDiscordMessageNonce, R as DISCORD_REST_TIMEOUT_MS, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, _ as DiscordSendError, b as canViewDiscordGuildChannel, g as DISCORD_MAX_STICKER_BYTES, h as DISCORD_MAX_EVENT_COVER_BYTES, i as formatReactionEmoji, k as resolveDiscordMessageFlags, l as resolveChannelId, m as DISCORD_MAX_EMOJI_BYTES, n as buildDiscordTextChunks, o as normalizeEmojiName, p as sendDiscordText, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-3gLZcqCz.mjs";
4
- import { n as sendPollDiscord, o as rewriteDiscordKnownMentions, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DR2oYnMr.mjs";
1
+ import { $t as listGuildRoles, At as getChannel, B as readRetryAfter, Bt as addGuildMemberRole, Ct as listMessageReactionUsers, Dt as deleteChannelMessage, Et as deleteChannel, F as DiscordError, Ft as listChannelPins, Gt as createGuildSticker, Ht as createGuildChannel, I as RateLimitError, It as pinChannelMessage, Jt as getGuildMember, Kt as deleteChannelPermission, L as isUnknownDiscordVoiceStateError, Lt as searchGuildMessages, Nt as listChannelArchivedThreads, Ot as editChannel, Pt as listChannelMessages, Qt as listGuildEmojis, R as readDiscordCode, Rt as sendChannelTyping, St as deleteOwnMessageReaction, Tt as createThread, Ut as createGuildEmoji, Vt as createGuildBan, Wt as createGuildScheduledEvent, Xt as listGuildActiveThreads, Yt as getGuildVoiceState, Zt as listGuildChannels, a as chunkDiscordTextWithMode, an as timeoutGuildMember, c as createDiscordSendResult, d as resolveDiscordReplyMessageId, en as listGuildScheduledEvents, i as recordDiscordMessageCreateAmbiguity, in as removeGuildMemberRole, jt as getChannelMessage, kt as editChannelMessage, n as createDiscordRetryRunner, nn as putChannelPermission, on as __exportAll, qt as getGuild, rn as removeGuildMember, s as createDiscordSendReceiptFromResults, t as classifyDiscordDeliveryFailure, tn as moveGuildChannels, xt as createOwnMessageReaction, z as readDiscordMessage, zt as unpinChannelMessage } from "./retry-BtpfSmcV.mjs";
2
+ import { n as parseDiscordRetryAfterBodySeconds } from "./channel-type-CGDUPxwc.mjs";
3
+ import { C as hasAllGuildPermissionsDiscord, I as resolveDiscordClientAccountContext, K as parseAndResolveChannelRecipient, L as resolveDiscordRest, M as resolveDiscordSuppressEmbeds, N as createDiscordClient, O as createDiscordMessageNonce, R as DISCORD_REST_TIMEOUT_MS, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, _ as DiscordSendError, b as canViewDiscordGuildChannel, g as DISCORD_MAX_STICKER_BYTES, h as DISCORD_MAX_EVENT_COVER_BYTES, i as formatReactionEmoji, k as resolveDiscordMessageFlags, l as resolveChannelId, m as DISCORD_MAX_EMOJI_BYTES, n as buildDiscordTextChunks, o as normalizeEmojiName, p as sendDiscordText, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-BljlFDUk.mjs";
4
+ import { n as sendPollDiscord, o as rewriteDiscordKnownMentions, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-Cne1E1Ys.mjs";
5
5
  import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-D86uWLt_.mjs";
6
6
  import fs from "node:fs/promises";
7
7
  import { ChannelType } from "discord-api-types/v10";
@@ -454,11 +454,6 @@ async function sendWebhookMessageDiscord(text, opts) {
454
454
  const webhookId = normalizeOptionalString(opts.webhookId) ?? "";
455
455
  const webhookToken = normalizeOptionalString(opts.webhookToken) ?? "";
456
456
  if (!webhookId || !webhookToken) throw new Error("Discord webhook id/token are required");
457
- const replyTo = normalizeOptionalString(opts.replyTo) ?? "";
458
- const messageReference = replyTo ? {
459
- message_id: replyTo,
460
- fail_if_not_exists: false
461
- } : void 0;
462
457
  const { account, proxyFetch } = resolveDiscordClientAccountContext({
463
458
  cfg: opts.cfg,
464
459
  accountId: opts.accountId
@@ -486,52 +481,70 @@ async function sendWebhookMessageDiscord(text, opts) {
486
481
  operation: "discord.webhook.send"
487
482
  });
488
483
  const request = createDiscordRetryRunner({ signal: deadline.signal });
484
+ const chunks = chunkDiscordTextWithMode(rewrittenText, { maxLines: opts.maxLinesPerMessage ?? account.config.maxLinesPerMessage });
485
+ const results = [];
489
486
  try {
490
- const response = await request(async () => {
491
- await opts.onPlatformSendDispatch?.();
492
- opts.assertPlatformSendAuthorized?.();
493
- const attemptResponse = await (proxyFetch ?? fetch)(url, {
494
- method: "POST",
495
- headers: { "content-type": "application/json" },
496
- body: JSON.stringify({
497
- content: rewrittenText,
498
- username: normalizeOptionalString(opts.username),
499
- avatar_url: normalizeOptionalString(opts.avatarUrl),
500
- ...flags ? { flags } : {},
501
- ...messageReference ? { message_reference: messageReference } : {}
502
- }),
503
- signal: deadline.signal
487
+ for (const content of chunks.length ? chunks : [""]) {
488
+ const replyTo = resolveDiscordReplyMessageId(opts.replyTo, results.length === 0);
489
+ const messageReference = replyTo ? {
490
+ message_id: replyTo,
491
+ fail_if_not_exists: false
492
+ } : void 0;
493
+ const response = await request(async () => {
494
+ await opts.onPlatformSendDispatch?.();
495
+ opts.assertPlatformSendAuthorized?.();
496
+ const attemptResponse = await (proxyFetch ?? fetch)(url, {
497
+ method: "POST",
498
+ headers: { "content-type": "application/json" },
499
+ body: JSON.stringify({
500
+ content,
501
+ username: normalizeOptionalString(opts.username),
502
+ avatar_url: normalizeOptionalString(opts.avatarUrl),
503
+ ...flags ? { flags } : {},
504
+ ...messageReference ? { message_reference: messageReference } : {}
505
+ }),
506
+ signal: deadline.signal
507
+ });
508
+ if (!attemptResponse.ok) await throwWebhookResponseError(attemptResponse, deadline.signal);
509
+ return attemptResponse;
510
+ }, "webhook", { safety: "non-idempotent-create" });
511
+ const payload = response.status === 204 ? {} : await readProviderJsonResponse(response, "Discord webhook send").catch(() => {
512
+ throwIfWebhookDeadlineExpired(deadline.signal);
513
+ return {};
504
514
  });
505
- if (!attemptResponse.ok) await throwWebhookResponseError(attemptResponse, deadline.signal);
506
- return attemptResponse;
507
- }, "webhook", { safety: "non-idempotent-create" });
508
- const payload = response.status === 204 ? {} : await readProviderJsonResponse(response, "Discord webhook send").catch(() => {
509
- throwIfWebhookDeadlineExpired(deadline.signal);
510
- return {};
511
- });
512
- try {
513
- recordChannelActivity({
515
+ try {
516
+ recordChannelActivity({
517
+ channel: "discord",
518
+ accountId: account.accountId,
519
+ direction: "outbound"
520
+ });
521
+ } catch {}
522
+ const result = createDiscordSendResult({
523
+ result: payload,
524
+ fallbackChannelId: opts.threadId ? String(opts.threadId) : "",
525
+ kind: "text",
526
+ ...opts.threadId != null ? { threadId: opts.threadId } : {},
527
+ ...replyTo ? { replyToId: replyTo } : {}
528
+ });
529
+ const resultConversationId = result.channelId.trim();
530
+ if (result.messageId !== "unknown" && resultConversationId) recordOutboundMessageIdentity({
514
531
  channel: "discord",
515
532
  accountId: account.accountId,
516
- direction: "outbound"
533
+ conversationId: resultConversationId,
534
+ messageId: result.messageId,
535
+ sourceId: webhookId
517
536
  });
518
- } catch {}
519
- const result = createDiscordSendResult({
520
- result: payload,
521
- fallbackChannelId: opts.threadId ? String(opts.threadId) : "",
522
- kind: "text",
523
- ...opts.threadId != null ? { threadId: opts.threadId } : {},
524
- ...replyTo ? { replyToId: replyTo } : {}
525
- });
526
- const resultConversationId = result.channelId.trim();
527
- if (result.messageId !== "unknown" && resultConversationId) recordOutboundMessageIdentity({
528
- channel: "discord",
529
- accountId: account.accountId,
530
- conversationId: resultConversationId,
531
- messageId: result.messageId,
532
- sourceId: webhookId
533
- });
534
- return result;
537
+ results.push(result);
538
+ }
539
+ const last = results.at(-1);
540
+ if (!last) throw new Error("Discord webhook delivery produced no result");
541
+ return results.length === 1 ? last : {
542
+ ...last,
543
+ receipt: createDiscordSendReceiptFromResults({ results })
544
+ };
545
+ } catch (error) {
546
+ if (results.length) recordDiscordMessageCreateAmbiguity(error);
547
+ throw error;
535
548
  } finally {
536
549
  deadline.cleanup();
537
550
  }
@@ -1,8 +1,8 @@
1
- import { c as createDiscordSendResult, kt as editChannelMessage, on as __exportAll, q as serializePayload, wt as createChannelMessage } from "./retry-B_XP5NOZ.mjs";
2
- import { d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName } from "./components-CEeBxgcs.mjs";
1
+ import { c as createDiscordSendResult, kt as editChannelMessage, on as __exportAll, q as serializePayload, wt as createChannelMessage } from "./retry-BtpfSmcV.mjs";
2
+ import { d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName } from "./components-CoCQebYz.mjs";
3
3
  import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
4
- import { E as SUPPRESS_NOTIFICATIONS_FLAG, K as parseAndResolveChannelRecipient, N as createDiscordClient, O as createDiscordMessageNonce, l as resolveChannelId, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-3gLZcqCz.mjs";
5
- import { t as sendMessageDiscord } from "./send.outbound-DR2oYnMr.mjs";
4
+ import { E as SUPPRESS_NOTIFICATIONS_FLAG, K as parseAndResolveChannelRecipient, N as createDiscordClient, O as createDiscordMessageNonce, l as resolveChannelId, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-BljlFDUk.mjs";
5
+ import { t as sendMessageDiscord } from "./send.outbound-Cne1E1Ys.mjs";
6
6
  import { ChannelType } from "discord-api-types/v10";
7
7
  import { asDateTimestampMs, isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
8
8
  import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,6 +1,6 @@
1
- import { Tt as createThread, c as createDiscordSendResult, s as createDiscordSendReceiptFromResults, u as createReusableDiscordReplyReference, wt as createChannelMessage } from "./retry-B_XP5NOZ.mjs";
2
- import { i as normalizeDiscordHandleKey, o as resolveDiscordDirectoryUserId } from "./directory-live-N2I3Zs-M.mjs";
3
- import { A as resolveDiscordSendComponents, D as buildDiscordMessageRequest, K as parseAndResolveChannelRecipient, M as resolveDiscordSuppressEmbeds, N as createDiscordClient, O as createDiscordMessageNonce, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, j as resolveDiscordSendEmbeds, k as resolveDiscordMessageFlags, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-3gLZcqCz.mjs";
1
+ import { Tt as createThread, c as createDiscordSendResult, s as createDiscordSendReceiptFromResults, u as createReusableDiscordReplyReference, wt as createChannelMessage } from "./retry-BtpfSmcV.mjs";
2
+ import { i as normalizeDiscordHandleKey, o as resolveDiscordDirectoryUserId } from "./directory-live-D12MauCI.mjs";
3
+ import { A as resolveDiscordSendComponents, D as buildDiscordMessageRequest, K as parseAndResolveChannelRecipient, M as resolveDiscordSuppressEmbeds, N as createDiscordClient, O as createDiscordMessageNonce, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, j as resolveDiscordSendEmbeds, k as resolveDiscordMessageFlags, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-BljlFDUk.mjs";
4
4
  import { ChannelType } from "discord-api-types/v10";
5
5
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
6
6
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,7 +1,7 @@
1
- import { At as getChannel, J as Embed, Jt as getGuildMember, K as hasDiscordV2Components, Mt as getThreadMember, P as RequestClient, a as chunkDiscordTextWithMode, bt as getCurrentUser, d as resolveDiscordReplyMessageId, n as createDiscordRetryRunner, q as serializePayload, qt as getGuild, wt as createChannelMessage, yt as createUserDmChannel } from "./retry-B_XP5NOZ.mjs";
1
+ import { At as getChannel, J as Embed, Jt as getGuildMember, K as hasDiscordV2Components, Mt as getThreadMember, P as RequestClient, a as chunkDiscordTextWithMode, bt as getCurrentUser, d as resolveDiscordReplyMessageId, n as createDiscordRetryRunner, q as serializePayload, qt as getGuild, wt as createChannelMessage, yt as createUserDmChannel } from "./retry-BtpfSmcV.mjs";
2
+ import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
2
3
  import { c as resolveDiscordAccount, m as normalizeDiscordToken, o as mergeDiscordAccountConfig } from "./accounts-CwJQoLjM.mjs";
3
- import { t as parseAndResolveDiscordTarget } from "./target-resolver-C1JWPpuA.mjs";
4
- import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.mjs";
4
+ import { t as parseAndResolveDiscordTarget } from "./target-resolver-8yRFu_yi.mjs";
5
5
  import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
6
6
  import { randomBytes } from "node:crypto";
7
7
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
@@ -474,7 +474,9 @@ async function fetchChannelPermissionsDiscord(channelId, opts) {
474
474
  const channel = await getChannel(rest, channelId);
475
475
  opts.signal?.throwIfAborted();
476
476
  const channelType = "type" in channel ? channel.type : void 0;
477
- const guildId = "guild_id" in channel ? channel.guild_id : void 0;
477
+ const permissionChannel = await resolveChannelPermissionSubject(rest, channel);
478
+ opts.signal?.throwIfAborted();
479
+ const guildId = "guild_id" in permissionChannel ? permissionChannel.guild_id : void 0;
478
480
  if (!guildId) return {
479
481
  channelId,
480
482
  permissions: [],
@@ -491,7 +493,7 @@ async function fetchChannelPermissionsDiscord(channelId, opts) {
491
493
  userId: botId,
492
494
  guild,
493
495
  member,
494
- channel
496
+ channel: permissionChannel
495
497
  });
496
498
  return {
497
499
  channelId,
@@ -528,6 +530,9 @@ const DISCORD_CANNOT_DM = 50007;
528
530
  const DISCORD_UPLOAD_TOO_LARGE = 40005;
529
531
  const DISCORD_UPLOAD_TOO_LARGE_STATUS = 413;
530
532
  const DISCORD_UPLOAD_TOO_LARGE_NOTICE = "Attachment skipped: Discord rejected the file as too large.";
533
+ function resolveRequiredDiscordSendPermissions(channelType) {
534
+ return isDiscordThreadChannelType(channelType) ? ["ViewChannel", "SendMessagesInThreads"] : ["ViewChannel", "SendMessages"];
535
+ }
531
536
  function normalizeReactionEmoji(raw) {
532
537
  const trimmed = raw.trim();
533
538
  if (!trimmed) throw new Error("emoji required");
@@ -597,15 +602,13 @@ async function buildDiscordSendError(err, ctx) {
597
602
  });
598
603
  probedChannelType = permissions.channelType;
599
604
  const current = new Set(permissions.permissions);
600
- const required = ["ViewChannel", "SendMessages"];
601
- if (isDiscordThreadChannelType(probedChannelType)) required.push("SendMessagesInThreads");
605
+ const required = resolveRequiredDiscordSendPermissions(probedChannelType);
602
606
  if (ctx.hasMedia) required.push("AttachFiles");
603
607
  missing = required.filter((permission) => !current.has(permission));
604
608
  } catch {}
605
609
  const status = getDiscordErrorStatus(err);
606
610
  const apiDetails = [`code=${code}`, status != null ? `status=${status}` : void 0].filter(Boolean).join(" ");
607
- const probedPermissions = ["ViewChannel", "SendMessages"];
608
- if (isDiscordThreadChannelType(probedChannelType)) probedPermissions.push("SendMessagesInThreads");
611
+ const probedPermissions = resolveRequiredDiscordSendPermissions(probedChannelType);
609
612
  if (ctx.hasMedia) probedPermissions.push("AttachFiles");
610
613
  const probeSummary = probedPermissions.join("/");
611
614
  return new DiscordSendError(`${missing.length ? `discord missing permissions in channel ${ctx.channelId}: ${missing.join(", ")}` : `discord missing permissions in channel ${ctx.channelId}; permission probe did not identify missing ${probeSummary}`} (${apiDetails}). bot might be blocked by channel/thread overrides, archived thread state, reply target visibility, or app-role position`, {
@@ -0,0 +1,3 @@
1
+ import { t as discordSetupPlugin } from "./channel.setup-Bur0l9L5.mjs";
2
+ import "../setup-plugin-api.js";
3
+ export { discordSetupPlugin };
@@ -117,7 +117,7 @@ const DISCORD_LEGACY_CONFIG_RULES = [];
117
117
  //#endregion
118
118
  //#region extensions/discord/src/shared.ts
119
119
  const DISCORD_CHANNEL = "discord";
120
- const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-BHWMlh0v.mjs"));
120
+ const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-BFwyA5iJ.mjs"));
121
121
  const discordDoctor = {
122
122
  dmAllowFromMode: "topOnly",
123
123
  groupModel: "route",
@@ -1,5 +1,5 @@
1
- import { on as __exportAll } from "./retry-B_XP5NOZ.mjs";
2
- import { o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-DB2lxpj7.mjs";
1
+ import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
2
+ import { o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-W-yX7LUM.mjs";
3
3
  import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/discord/src/subagent-hooks.ts
5
5
  var subagent_hooks_exports = /* @__PURE__ */ __exportAll({
@@ -1,4 +1,4 @@
1
- import { y as discord_exports } from "./retry-B_XP5NOZ.mjs";
1
+ import { y as discord_exports } from "./retry-BtpfSmcV.mjs";
2
2
  import { x as formatDiscordUserTag } from "./allow-list-C2JuH-R0.mjs";
3
3
  //#region extensions/discord/src/monitor/system-events.ts
4
4
  function resolveDiscordSystemEvent(message, location) {
@@ -1,6 +1,6 @@
1
- import { _ as parseDiscordTarget, on as __exportAll, p as allowFromContainsDiscordUserId } from "./retry-B_XP5NOZ.mjs";
1
+ import { _ as parseDiscordTarget, on as __exportAll, p as allowFromContainsDiscordUserId } from "./retry-BtpfSmcV.mjs";
2
2
  import { c as resolveDiscordAccount, l as resolveDiscordAccountAllowFrom } from "./accounts-CwJQoLjM.mjs";
3
- import { a as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-N2I3Zs-M.mjs";
3
+ import { a as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-D12MauCI.mjs";
4
4
  import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
5
5
  //#region extensions/discord/src/send-target-parsing.ts
6
6
  const parseDiscordSendTarget = (raw, options = {}) => parseDiscordTarget(raw, options);
@@ -0,0 +1,3 @@
1
+ import "./retry-BtpfSmcV.mjs";
2
+ import "./target-resolver-8yRFu_yi.mjs";
3
+ export {};
@@ -1,8 +1,8 @@
1
- import { _ as parseDiscordTarget, on as __exportAll } from "./retry-B_XP5NOZ.mjs";
2
- import "./targets-BdyllneU.mjs";
1
+ import { _ as parseDiscordTarget, on as __exportAll } from "./retry-BtpfSmcV.mjs";
2
+ import "./targets-ueZDqOW4.mjs";
3
3
  import { C as resolveThreadBindingMaxAgeExpiresAt, O as shouldPersistBindingMutations, S as resolveThreadBindingInactivityExpiresAt, T as saveBindingsToDisk, h as refreshUnboundThreadWebhookIdentity, m as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, v as removeBindingRecord, w as resolveThreadBindingMaxAgeMs$1, x as resolveThreadBindingIdleTimeoutMs$1 } from "./thread-bindings.state-CIba-55B.mjs";
4
4
  import { n as setThreadBindingMaxAgeBySessionKey, r as resolveBindingIdsForTargetSession, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D04Avc2y.mjs";
5
- import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, o as resolveChannelIdForBinding, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-BgOMPrjG.mjs";
5
+ import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, o as resolveChannelIdForBinding, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-DWsWOJ_n.mjs";
6
6
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
7
7
  import { normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
@@ -1,8 +1,8 @@
1
- import { At as getChannel, on as __exportAll, v as resolveDiscordChannelId, vt as createChannelWebhook } from "./retry-B_XP5NOZ.mjs";
2
- import { P as createDiscordRestClient } from "./send.shared-3gLZcqCz.mjs";
3
- import { t as sendMessageDiscord } from "./send.outbound-DR2oYnMr.mjs";
4
- import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.mjs";
5
- import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-CymvczbX.mjs";
1
+ import { At as getChannel, on as __exportAll, v as resolveDiscordChannelId, vt as createChannelWebhook } from "./retry-BtpfSmcV.mjs";
2
+ import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
3
+ import { P as createDiscordRestClient } from "./send.shared-BljlFDUk.mjs";
4
+ import { t as sendMessageDiscord } from "./send.outbound-Cne1E1Ys.mjs";
5
+ import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-jx1xq6VI.mjs";
6
6
  import { A as toReusableWebhookKey, C as resolveThreadBindingMaxAgeExpiresAt, D as shouldDefaultPersist, E as setBindingRecord, S as resolveThreadBindingInactivityExpiresAt, T as saveBindingsToDisk, _ as rememberThreadBindingToken, b as resolveBindingRecordKey, c as ensureBindingsLoaded, f as normalizeTargetKind, g as rememberReusableWebhook, h as refreshUnboundThreadWebhookIdentity, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, l as forgetThreadBindingToken, m as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, p as normalizeThreadBindingDurationMs, r as PERSIST_BY_ACCOUNT_ID, s as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, v as removeBindingRecord, w as resolveThreadBindingMaxAgeMs$1, x as resolveThreadBindingIdleTimeoutMs$1, y as resolveBindingIdsForSession } from "./thread-bindings.state-CIba-55B.mjs";
7
7
  import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
8
8
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
@@ -1,7 +1,7 @@
1
- import { F as DiscordError, Ot as editChannel, Tt as createThread, jt as getChannelMessage, on as __exportAll, y as discord_exports } from "./retry-B_XP5NOZ.mjs";
2
- import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.mjs";
3
- import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-BgOMPrjG.mjs";
4
- import { a as formatDiscordMediaText, h as resolveDiscordMessageChannelId, m as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText } from "./message-text-DSUwjMvz.mjs";
1
+ import { F as DiscordError, Ot as editChannel, Tt as createThread, jt as getChannelMessage, on as __exportAll, y as discord_exports } from "./retry-BtpfSmcV.mjs";
2
+ import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
3
+ import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-DWsWOJ_n.mjs";
4
+ import { a as formatDiscordMediaText, h as resolveDiscordMessageChannelId, m as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText } from "./message-text-D1pWUazL.mjs";
5
5
  import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
6
6
  import { normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
@@ -1,4 +1,4 @@
1
- import { on as __exportAll } from "./retry-B_XP5NOZ.mjs";
1
+ import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
2
2
  import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-CwJQoLjM.mjs";
3
3
  import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-B7G6o_bq.mjs";
4
4
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
@@ -1,4 +1,4 @@
1
- import { Rt as sendChannelTyping, on as __exportAll } from "./retry-B_XP5NOZ.mjs";
1
+ import { Rt as sendChannelTyping, on as __exportAll } from "./retry-BtpfSmcV.mjs";
2
2
  import { c as raceWithTimeout } from "./timeouts-D86uWLt_.mjs";
3
3
  //#region extensions/discord/src/monitor/typing.ts
4
4
  var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });