@openclaw/discord 2026.10.10 → 2026.11.5-beta.1
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.
- package/dist/.setup/{account-inspect-X_Xlr42B.mjs → account-inspect-CSz5Qodj.mjs} +1 -1
- package/dist/.setup/{accounts-C18HNgge.mjs → accounts-DtjvhJUj.mjs} +9 -6
- package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-DahA0Jxh.mjs} +3 -150
- package/dist/.setup/{api-Bth1wKF9.mjs → api-Bp0HI4q3.mjs} +10 -20
- package/dist/.setup/{approval-handler.runtime-BAoEELJJ.mjs → approval-handler.runtime-Cy53ugTf.mjs} +80 -61
- package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-DqOXxPss.mjs} +2 -2
- package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-DoPKOfQE.mjs} +4 -4
- package/dist/.setup/{channel-BMpMAeQL.mjs → channel-Ds6iuNdy.mjs} +134 -201
- package/dist/.setup/channel-access-DhJhVrdZ.mjs +23 -0
- package/dist/.setup/channel.setup-BLt9dkIG.mjs +235 -0
- package/dist/.setup/{components-BvOWSPxr.mjs → components-WTfUxead.mjs} +208 -426
- package/dist/.setup/components.base-C5sAPHe4.mjs +31 -0
- package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-GX2yDgIH.mjs} +6 -7
- package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-CZdm-X5A.mjs} +2 -2
- package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-BXJuh9-J.mjs} +1 -1
- package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-CEopeb8Q.mjs} +55 -62
- package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-r79VFjJp.mjs} +1087 -1664
- package/dist/.setup/{doctor-Dty_Ossy.mjs → doctor-UfLW8nye.mjs} +3 -5
- package/dist/.setup/endpoint-runtime-BM3x-m6O.mjs +138 -0
- package/dist/.setup/guilds-DQucP5Tn.mjs +21 -0
- package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-BarHOi-v.mjs} +15 -15
- package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-oRUb8p_O.mjs} +5 -5
- package/dist/.setup/listeners-CHgTENFu.mjs +46 -0
- package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-EKp4O6zx.mjs} +2 -3
- package/dist/.setup/{message-handler-fL1j1NiR.mjs → message-handler-DUeT8Asf.mjs} +154 -113
- package/dist/.setup/{message-handler.preflight-DkjwNZAd.mjs → message-handler.preflight-C6TNtKW0.mjs} +30 -104
- package/dist/.setup/{message-handler.preflight-pluralkit-DR4BnvMU.mjs → message-handler.preflight-pluralkit-6E9TFmmN.mjs} +9 -22
- package/dist/.setup/{message-handler.process-ClOwIPDK.mjs → message-handler.process-D8_oQ5Cp.mjs} +256 -367
- package/dist/.setup/outbound-payload-DUsrFICb.mjs +445 -0
- package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-Cb8cv4Oi.mjs} +138 -86
- package/dist/.setup/{preflight-audio-CwtPIsvk.mjs → preflight-audio-r4BbaJxh.mjs} +1 -5
- package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-B3xj3b0l.mjs} +1 -6
- package/dist/.setup/{probe-DNge7OEP.mjs → probe-BUmJyH35.mjs} +5 -9
- package/dist/.setup/{provider-BBDuE14w.mjs → provider-Dm2ERSxe.mjs} +3600 -4454
- package/dist/.setup/{provider-session.runtime-D8hMXXqJ.mjs → provider-session.runtime-DCIqDsIg.mjs} +3 -3
- package/dist/.setup/provider.runtime-DmxPGoUg.mjs +1 -0
- package/dist/.setup/proxy-fetch-B8cK6FLQ.mjs +29 -0
- package/dist/.setup/{realtime-session.runtime-cetognkp.mjs → realtime-session.runtime-WJL6NdwK.mjs} +43 -81
- package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-DV_v5ROf.mjs} +13 -27
- package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-C37fgnYG.mjs} +3 -12
- package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-CwpnQ7C2.mjs} +5 -4
- package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-D6jSwe8R.mjs} +4 -7
- package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-B-PgPsGR.mjs} +6 -6
- package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-DhOMlnYS.mjs} +196 -235
- package/dist/.setup/{secret-config-contract-BdbCvqnM.mjs → secret-config-contract-CP6teHec.mjs} +4 -9
- package/dist/.setup/{send-Cbq-IVsS.mjs → send-DnLL6XoO.mjs} +149 -174
- package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-xB43CksK.mjs} +61 -71
- package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-B11X6TOE.mjs} +75 -129
- package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-CMteCIZS.mjs} +29 -31
- package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-BcLLZBul.mjs} +38 -112
- package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-CGNpdJmb.mjs} +3 -9
- package/dist/.setup/setup-plugin-api-C6AMx3hu.mjs +2 -0
- package/dist/.setup/{shared-Bp0sxD5R.mjs → shared-BEYw16he.mjs} +8 -10
- package/dist/.setup/shared-interactive-DKBw4SNV.mjs +311 -0
- package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-DlYElpXa.mjs} +1 -1
- package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events--Pk6y9aP.mjs} +2 -2
- package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-Bo9EpGp_.mjs} +3 -3
- package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-BF-hr-bg.mjs} +12 -20
- package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-CQCkha5r.mjs} +22 -42
- package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-C2gJAj_I.mjs} +11 -18
- package/dist/.setup/{threading-l0UfrE6x.mjs → threading-HA9C2wYR.mjs} +68 -104
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CT9hnmo4.mjs} +1 -1
- package/dist/.setup/{transcripts-source-CGgOaWcu.mjs → transcripts-source-DzpzETZR.mjs} +102 -172
- package/dist/.setup/{voice-runtime-DY1EwDfi.mjs → voice-runtime-Bo_nsVvX.mjs} +231 -448
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +285 -337
- package/dist/api.js +16 -16
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/runtime-api.js +22 -22
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +56 -68
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +3339 -4021
- package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
- package/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@types/lodash/common/function.d.ts +2 -2
- package/node_modules/@types/lodash/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/rest/v10/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.js +8 -0
- package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.js +8 -0
- package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts.map +1 -1
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
- package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/utility.d.ts +4 -4
- package/node_modules/uuid/package.json +17 -17
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/openclaw.plugin.json +1 -31
- package/package.json +8 -8
- package/dist/.setup/channel-access-BPrWoEXM.mjs +0 -47
- package/dist/.setup/channel.setup-DVe7Y3Jf.mjs +0 -245
- package/dist/.setup/outbound-adapter-DWyAWBFh.mjs +0 -537
- package/dist/.setup/provider.runtime-BQ1z4Aq1.mjs +0 -1
- package/dist/.setup/setup-plugin-api-B4J6wmL1.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.mjs +0 -3
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { l as resolveDiscordAccount, o as listEnabledDiscordAccounts, u as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { l as resolveDiscordAccount, o as listEnabledDiscordAccounts, u as resolveDiscordAccountAllowFrom } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { k as getChannelMessage, t as discord_exports, z as DiscordError } from "./discord-r79VFjJp.mjs";
|
|
3
|
+
import { f as resolveDiscordGuildEntry, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, t as allowListMatches, w as isDiscordThreadChannelType } from "./allow-list-DahA0Jxh.mjs";
|
|
4
|
+
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
5
|
+
import { l as withAbortTimeout } from "./timeouts-CT9hnmo4.mjs";
|
|
5
6
|
import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-BzlhNBxA.mjs";
|
|
6
|
-
import {
|
|
7
|
+
import { t as resolveDiscordChannelInfoSafe } from "./channel-access-DhJhVrdZ.mjs";
|
|
7
8
|
import { createSubsystemLogger, getChildLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
8
9
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
9
10
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, summarizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
11
|
import { ComponentType, StickerFormatType } from "discord-api-types/v10";
|
|
11
|
-
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
12
12
|
import { saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
|
|
13
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
14
14
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
15
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
16
15
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
16
|
+
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
17
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
17
18
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
18
19
|
import { getFileExtension, normalizeMimeType } from "openclaw/plugin-sdk/media-mime";
|
|
19
20
|
import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
|
|
@@ -35,12 +36,11 @@ function normalizeDiscordChannelId(value) {
|
|
|
35
36
|
return normalizeOptionalStringifiedId(value) ?? "";
|
|
36
37
|
}
|
|
37
38
|
function resolveDiscordMessageChannelId(params) {
|
|
38
|
-
|
|
39
|
-
return normalizeDiscordChannelId(message.channelId) || normalizeDiscordChannelId(message.channel_id) || normalizeDiscordChannelId(message.rawData?.channel_id) || normalizeDiscordChannelId(params.eventChannelId);
|
|
39
|
+
return normalizeDiscordChannelId(params.message.channelId) || normalizeDiscordChannelId(params.eventChannelId);
|
|
40
40
|
}
|
|
41
|
-
function buildDiscordChannelInfo(channel
|
|
41
|
+
function buildDiscordChannelInfo(channel) {
|
|
42
42
|
const info = resolveDiscordChannelInfoSafe(channel);
|
|
43
|
-
const type = info.type
|
|
43
|
+
const type = info.type;
|
|
44
44
|
return type === void 0 ? null : {
|
|
45
45
|
type,
|
|
46
46
|
name: info.name,
|
|
@@ -62,7 +62,7 @@ async function resolveDiscordChannelInfo(client, channelId) {
|
|
|
62
62
|
cacheDiscordChannelInfo(channelId, null, DISCORD_CHANNEL_INFO_NEGATIVE_CACHE_TTL_MS, now);
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
|
-
const payload = buildDiscordChannelInfo(channel
|
|
65
|
+
const payload = buildDiscordChannelInfo(channel);
|
|
66
66
|
if (!payload) return null;
|
|
67
67
|
cacheDiscordChannelInfo(channelId, payload, DISCORD_CHANNEL_INFO_CACHE_TTL_MS, now);
|
|
68
68
|
return payload;
|
|
@@ -79,22 +79,16 @@ function normalizeDiscordStickerItems(value) {
|
|
|
79
79
|
return value.filter((entry) => Boolean(entry) && typeof entry === "object" && typeof entry.id === "string" && typeof entry.name === "string");
|
|
80
80
|
}
|
|
81
81
|
function resolveDiscordMessageStickers(message) {
|
|
82
|
-
const
|
|
83
|
-
const normalized = normalizeDiscordStickerItems(stickers);
|
|
82
|
+
const normalized = normalizeDiscordStickerItems(message.stickers);
|
|
84
83
|
if (normalized.length > 0) return normalized;
|
|
85
84
|
const rawData = message.rawData;
|
|
86
|
-
return normalizeDiscordStickerItems(rawData?.sticker_items ?? rawData?.stickers);
|
|
87
|
-
}
|
|
88
|
-
function resolveDiscordSnapshotStickers(snapshot) {
|
|
89
|
-
const stickers = normalizeDiscordStickerItems(snapshot.stickers);
|
|
90
|
-
return stickers.length > 0 ? stickers : normalizeDiscordStickerItems(snapshot.sticker_items);
|
|
85
|
+
return normalizeDiscordStickerItems(message.sticker_items ?? rawData?.sticker_items ?? rawData?.stickers);
|
|
91
86
|
}
|
|
92
87
|
function hasDiscordMessageStickers(message) {
|
|
93
88
|
return resolveDiscordMessageStickers(message).length > 0;
|
|
94
89
|
}
|
|
95
90
|
function resolveDiscordMessageSnapshots(message) {
|
|
96
|
-
|
|
97
|
-
return normalizeDiscordMessageSnapshots(rawData?.message_snapshots ?? message.message_snapshots ?? message.messageSnapshots);
|
|
91
|
+
return normalizeDiscordMessageSnapshots(message.rawData?.message_snapshots);
|
|
98
92
|
}
|
|
99
93
|
function normalizeDiscordMessageSnapshots(snapshots) {
|
|
100
94
|
if (!Array.isArray(snapshots)) return [];
|
|
@@ -115,10 +109,10 @@ function resolveDiscordReferencedReplyMessageId(message) {
|
|
|
115
109
|
}
|
|
116
110
|
function formatDiscordSnapshotAuthor(author) {
|
|
117
111
|
if (!author) return;
|
|
118
|
-
const globalName = normalizeOptionalString(author.global_name)
|
|
119
|
-
const username = normalizeOptionalString(author.username)
|
|
120
|
-
const name = normalizeOptionalString(author.name)
|
|
121
|
-
const discriminator = normalizeOptionalString(author.discriminator)
|
|
112
|
+
const globalName = normalizeOptionalString(author.global_name);
|
|
113
|
+
const username = normalizeOptionalString(author.username);
|
|
114
|
+
const name = normalizeOptionalString(author.name);
|
|
115
|
+
const discriminator = normalizeOptionalString(author.discriminator);
|
|
122
116
|
const base = globalName || username || name || author.id;
|
|
123
117
|
if (username && discriminator && discriminator !== "0") return `@${username}#${discriminator}`;
|
|
124
118
|
return base ? `@${base}` : void 0;
|
|
@@ -194,16 +188,64 @@ function resolveDiscordMediaClassification(params) {
|
|
|
194
188
|
};
|
|
195
189
|
}
|
|
196
190
|
async function resolveMessageMedia(message, operation, errorPrefix) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
191
|
+
const attachmentErrorPrefix = `${errorPrefix} attachment`;
|
|
192
|
+
for (const attachment of message.attachments ?? []) {
|
|
193
|
+
const attachmentUrl = normalizeOptionalString(attachment.url);
|
|
194
|
+
if (!attachmentUrl) {
|
|
195
|
+
logVerbose(`${attachmentErrorPrefix} ${attachment.id ?? "attachment"}: missing url`);
|
|
196
|
+
operation.out.push(resolveDiscordMediaClassification({ attachment }));
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
const saved = await fetchDiscordMedia(operation, {
|
|
201
|
+
url: attachmentUrl,
|
|
202
|
+
filePathHint: attachment.filename ?? attachmentUrl,
|
|
203
|
+
fallbackContentType: attachment.content_type,
|
|
204
|
+
originalFilename: attachment.filename
|
|
205
|
+
});
|
|
206
|
+
const classification = resolveDiscordMediaClassification({
|
|
207
|
+
attachment,
|
|
208
|
+
fetchedContentType: saved.contentType
|
|
209
|
+
});
|
|
210
|
+
operation.out.push({
|
|
211
|
+
path: saved.path,
|
|
212
|
+
fileName: attachment.filename,
|
|
213
|
+
...classification
|
|
214
|
+
});
|
|
215
|
+
} catch {
|
|
216
|
+
const id = attachment.id ?? "attachment";
|
|
217
|
+
getChildLogger({ module: "discord-media" }).warn(`${attachmentErrorPrefix} ${id}`);
|
|
218
|
+
operation.out.push(resolveDiscordMediaClassification({ attachment }));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const stickerErrorPrefix = `${errorPrefix} sticker`;
|
|
222
|
+
for (const sticker of resolveDiscordMessageStickers(message) ?? []) {
|
|
223
|
+
const candidates = resolveStickerAssetCandidates(sticker);
|
|
224
|
+
let downloaded = false;
|
|
225
|
+
for (const candidate of candidates) try {
|
|
226
|
+
const saved = await fetchDiscordMedia(operation, {
|
|
227
|
+
url: candidate.url,
|
|
228
|
+
filePathHint: candidate.fileName,
|
|
229
|
+
fallbackContentType: inferStickerContentType(sticker),
|
|
230
|
+
originalFilename: candidate.fileName
|
|
231
|
+
});
|
|
232
|
+
operation.out.push({
|
|
233
|
+
path: saved.path,
|
|
234
|
+
contentType: saved.contentType,
|
|
235
|
+
fileName: candidate.fileName,
|
|
236
|
+
kind: "sticker"
|
|
237
|
+
});
|
|
238
|
+
downloaded = true;
|
|
239
|
+
break;
|
|
240
|
+
} catch {}
|
|
241
|
+
if (!downloaded) {
|
|
242
|
+
getChildLogger({ module: "discord-media" }).warn(`${stickerErrorPrefix} ${sticker.id}`);
|
|
243
|
+
operation.out.push({
|
|
244
|
+
contentType: inferStickerContentType(sticker),
|
|
245
|
+
kind: "sticker"
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
207
249
|
return operation.out;
|
|
208
250
|
}
|
|
209
251
|
async function resolveMediaList(message, maxBytes, options) {
|
|
@@ -213,18 +255,7 @@ async function resolveForwardedMediaList(message, maxBytes, options) {
|
|
|
213
255
|
const snapshots = resolveDiscordMessageSnapshots(message);
|
|
214
256
|
const operation = createDiscordMediaOperation(maxBytes, options);
|
|
215
257
|
if (snapshots.length > 0) {
|
|
216
|
-
for (const snapshot of snapshots) {
|
|
217
|
-
await appendResolvedMediaFromAttachments({
|
|
218
|
-
...operation,
|
|
219
|
-
attachments: snapshot.message?.attachments,
|
|
220
|
-
errorPrefix: "discord: failed to download forwarded attachment"
|
|
221
|
-
});
|
|
222
|
-
await appendResolvedMediaFromStickers({
|
|
223
|
-
...operation,
|
|
224
|
-
stickers: snapshot.message ? resolveDiscordSnapshotStickers(snapshot.message) : [],
|
|
225
|
-
errorPrefix: "discord: failed to download forwarded sticker"
|
|
226
|
-
});
|
|
227
|
-
}
|
|
258
|
+
for (const snapshot of snapshots) await resolveMessageMedia(snapshot.message ?? {}, operation, "discord: failed to download forwarded");
|
|
228
259
|
return operation.out;
|
|
229
260
|
}
|
|
230
261
|
const referencedForward = resolveDiscordReferencedForwardMessage(message);
|
|
@@ -251,37 +282,6 @@ async function fetchDiscordMedia(operation, params) {
|
|
|
251
282
|
run: (signal) => save(operation.abortSignal ? AbortSignal.any([operation.abortSignal, signal]) : signal)
|
|
252
283
|
}) : save(operation.abortSignal);
|
|
253
284
|
}
|
|
254
|
-
async function appendResolvedMediaFromAttachments(params) {
|
|
255
|
-
for (const attachment of params.attachments ?? []) {
|
|
256
|
-
const attachmentUrl = normalizeOptionalString(attachment.url);
|
|
257
|
-
if (!attachmentUrl) {
|
|
258
|
-
logVerbose(`${params.errorPrefix} ${attachment.id ?? attachment.filename ?? "attachment"}: missing url`);
|
|
259
|
-
params.out.push(resolveDiscordMediaClassification({ attachment }));
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
try {
|
|
263
|
-
const saved = await fetchDiscordMedia(params, {
|
|
264
|
-
url: attachmentUrl,
|
|
265
|
-
filePathHint: attachment.filename ?? attachmentUrl,
|
|
266
|
-
fallbackContentType: attachment.content_type,
|
|
267
|
-
originalFilename: attachment.filename
|
|
268
|
-
});
|
|
269
|
-
const classification = resolveDiscordMediaClassification({
|
|
270
|
-
attachment,
|
|
271
|
-
fetchedContentType: saved.contentType
|
|
272
|
-
});
|
|
273
|
-
params.out.push({
|
|
274
|
-
path: saved.path,
|
|
275
|
-
fileName: attachment.filename,
|
|
276
|
-
...classification
|
|
277
|
-
});
|
|
278
|
-
} catch (err) {
|
|
279
|
-
const id = attachment.id ?? attachmentUrl;
|
|
280
|
-
getChildLogger({ module: "discord-media" }).warn(`${params.errorPrefix} ${id}: ${String(err)}`);
|
|
281
|
-
params.out.push(resolveDiscordMediaClassification({ attachment }));
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
285
|
function resolveStickerAssetCandidates(sticker) {
|
|
286
286
|
const baseName = sticker.name?.trim() || `sticker-${sticker.id}`;
|
|
287
287
|
const isLottie = sticker.format_type === StickerFormatType.Lottie;
|
|
@@ -290,15 +290,6 @@ function resolveStickerAssetCandidates(sticker) {
|
|
|
290
290
|
fileName: `${baseName}.${extension}`
|
|
291
291
|
}));
|
|
292
292
|
}
|
|
293
|
-
function formatStickerError(err) {
|
|
294
|
-
if (err instanceof Error) return err.message;
|
|
295
|
-
if (typeof err === "string") return err;
|
|
296
|
-
try {
|
|
297
|
-
return JSON.stringify(err) ?? "unknown error";
|
|
298
|
-
} catch {
|
|
299
|
-
return "unknown error";
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
293
|
function inferStickerContentType(sticker) {
|
|
303
294
|
switch (sticker.format_type) {
|
|
304
295
|
case StickerFormatType.GIF: return "image/gif";
|
|
@@ -308,37 +299,6 @@ function inferStickerContentType(sticker) {
|
|
|
308
299
|
default: return;
|
|
309
300
|
}
|
|
310
301
|
}
|
|
311
|
-
async function appendResolvedMediaFromStickers(params) {
|
|
312
|
-
for (const sticker of params.stickers ?? []) {
|
|
313
|
-
const candidates = resolveStickerAssetCandidates(sticker);
|
|
314
|
-
let lastError;
|
|
315
|
-
for (const candidate of candidates) try {
|
|
316
|
-
const saved = await fetchDiscordMedia(params, {
|
|
317
|
-
url: candidate.url,
|
|
318
|
-
filePathHint: candidate.fileName,
|
|
319
|
-
fallbackContentType: inferStickerContentType(sticker),
|
|
320
|
-
originalFilename: candidate.fileName
|
|
321
|
-
});
|
|
322
|
-
params.out.push({
|
|
323
|
-
path: saved.path,
|
|
324
|
-
contentType: saved.contentType,
|
|
325
|
-
fileName: candidate.fileName,
|
|
326
|
-
kind: "sticker"
|
|
327
|
-
});
|
|
328
|
-
lastError = null;
|
|
329
|
-
break;
|
|
330
|
-
} catch (err) {
|
|
331
|
-
lastError = err;
|
|
332
|
-
}
|
|
333
|
-
if (lastError) {
|
|
334
|
-
getChildLogger({ module: "discord-media" }).warn(`${params.errorPrefix} ${sticker.id}: ${formatStickerError(lastError)}`);
|
|
335
|
-
params.out.push({
|
|
336
|
-
contentType: inferStickerContentType(sticker),
|
|
337
|
-
kind: "sticker"
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
302
|
function isImageAttachment(attachment) {
|
|
343
303
|
if ((attachment.content_type ?? "").startsWith("image/")) return true;
|
|
344
304
|
const name = normalizeLowercaseStringOrEmpty(attachment.filename);
|
|
@@ -350,11 +310,8 @@ function formatDiscordMediaText(params) {
|
|
|
350
310
|
return formatMediaPlaceholderText([...(params.attachments ?? []).map((attachment) => resolveDiscordMediaClassification({ attachment })), ...(params.stickers ?? []).map(() => ({ kind: "sticker" }))]);
|
|
351
311
|
}
|
|
352
312
|
// extensions/discord/src/monitor/message-text.ts
|
|
353
|
-
function resolveDiscordEmbedText(embeds) {
|
|
354
|
-
return (embeds ?? []).flatMap(({ title, description }) => [normalizeOptionalString(title), normalizeOptionalString(description)]).filter(Boolean).join("\n");
|
|
355
|
-
}
|
|
356
313
|
function resolveDiscordMessageText(message, options) {
|
|
357
|
-
const baseText = resolveDiscordMentions(resolveDiscordMessageMentionDocuments(message).map((text) => text.trim()).join("\n") ||
|
|
314
|
+
const baseText = resolveDiscordMentions(resolveDiscordMessageMentionDocuments(message).map((text) => text.trim()).join("\n") || "", message);
|
|
358
315
|
if (!options?.includeForwarded) return baseText;
|
|
359
316
|
return [baseText, resolveDiscordForwardedMessagesText(message)].filter(Boolean).join("\n");
|
|
360
317
|
}
|
|
@@ -364,7 +321,7 @@ function resolveDiscordMessageMentionDocuments(message) {
|
|
|
364
321
|
const embedDocuments = (message.embeds ?? []).flatMap(({ title, description }) => [title, description].filter((value) => typeof value === "string" && Boolean(value.trim())));
|
|
365
322
|
if (embedDocuments.length > 0) return embedDocuments;
|
|
366
323
|
const componentDocuments = [];
|
|
367
|
-
collectDiscordTextDisplayDocuments(
|
|
324
|
+
collectDiscordTextDisplayDocuments(message.components, componentDocuments);
|
|
368
325
|
return componentDocuments;
|
|
369
326
|
}
|
|
370
327
|
function resolveDiscordMessageBatch(last, preceding) {
|
|
@@ -382,16 +339,6 @@ function resolveDiscordMessageBatch(last, preceding) {
|
|
|
382
339
|
enumerable: true,
|
|
383
340
|
configurable: true
|
|
384
341
|
},
|
|
385
|
-
message_snapshots: {
|
|
386
|
-
value: last.message_snapshots,
|
|
387
|
-
enumerable: true,
|
|
388
|
-
configurable: true
|
|
389
|
-
},
|
|
390
|
-
messageSnapshots: {
|
|
391
|
-
value: last.messageSnapshots,
|
|
392
|
-
enumerable: true,
|
|
393
|
-
configurable: true
|
|
394
|
-
},
|
|
395
342
|
rawData: {
|
|
396
343
|
value: { ...last.rawData },
|
|
397
344
|
enumerable: true,
|
|
@@ -402,7 +349,7 @@ function resolveDiscordMessageBatch(last, preceding) {
|
|
|
402
349
|
/** Adds native media text only for history surfaces that cannot carry structured facts. */
|
|
403
350
|
function resolveDiscordMessageHistoryText(message, options) {
|
|
404
351
|
return [resolveDiscordMessageText(message, options), formatDiscordMediaText({
|
|
405
|
-
attachments: message.attachments
|
|
352
|
+
attachments: message.attachments,
|
|
406
353
|
stickers: resolveDiscordMessageStickers(message)
|
|
407
354
|
})].filter(Boolean).join("\n");
|
|
408
355
|
}
|
|
@@ -424,15 +371,6 @@ function resolveDiscordForwardedMessagesText(message) {
|
|
|
424
371
|
if (!referencedForward) return "";
|
|
425
372
|
return formatDiscordForwardedMessageBlock(resolveDiscordMessageHistoryText(referencedForward), referencedForward.author);
|
|
426
373
|
}
|
|
427
|
-
function resolveDiscordMessageComponents(message) {
|
|
428
|
-
const components = message.components;
|
|
429
|
-
if (components !== void 0) return components;
|
|
430
|
-
try {
|
|
431
|
-
return message.rawData?.components;
|
|
432
|
-
} catch {
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
374
|
function extractDiscordComponentsV2Text(components) {
|
|
437
375
|
const parts = [];
|
|
438
376
|
collectDiscordTextDisplayDocuments(components, parts);
|
|
@@ -462,9 +400,9 @@ function resolveDiscordRawMessageText(message) {
|
|
|
462
400
|
const content = normalizeOptionalString(message.content) ?? "";
|
|
463
401
|
const mediaText = formatDiscordMediaText({
|
|
464
402
|
attachments: message.attachments ?? void 0,
|
|
465
|
-
stickers:
|
|
403
|
+
stickers: resolveDiscordMessageStickers(message)
|
|
466
404
|
});
|
|
467
|
-
return [content ||
|
|
405
|
+
return [content || (message.embeds ?? []).flatMap(({ title, description }) => [normalizeOptionalString(title), normalizeOptionalString(description)]).filter(Boolean).join("\n") || extractDiscordComponentsV2Text(message.components) || resolveDiscordForwardedMessagesTextFromSnapshots(normalizeDiscordMessageSnapshots(message.message_snapshots)), mediaText].filter(Boolean).join("\n");
|
|
468
406
|
}
|
|
469
407
|
// extensions/discord/src/monitor/threading.cache.ts
|
|
470
408
|
const DISCORD_THREAD_STARTER_CACHE_TTL_MS = 3e5;
|
|
@@ -496,28 +434,23 @@ const IN_FLIGHT_DISCORD_THREAD_STARTERS = /* @__PURE__ */ new Map();
|
|
|
496
434
|
function resolveDiscordThreadChannel(params) {
|
|
497
435
|
if (!params.isGuildMessage) return null;
|
|
498
436
|
const { message, channelInfo } = params;
|
|
499
|
-
const channel = "channel" in message ? message.channel : void 0;
|
|
500
|
-
if (channel && typeof channel === "object" && "isThread" in channel && typeof channel.isThread === "function" && channel.isThread()) return channel;
|
|
501
437
|
if (!isDiscordThreadChannelType(channelInfo?.type)) return null;
|
|
502
438
|
const messageChannelId = params.messageChannelId || resolveDiscordMessageChannelId({ message });
|
|
503
439
|
if (!messageChannelId) return null;
|
|
504
440
|
return {
|
|
505
441
|
id: messageChannelId,
|
|
506
|
-
name: channelInfo?.name
|
|
507
|
-
parentId: channelInfo?.parentId
|
|
508
|
-
|
|
509
|
-
ownerId: channelInfo?.ownerId ?? void 0
|
|
442
|
+
name: channelInfo?.name,
|
|
443
|
+
parentId: channelInfo?.parentId,
|
|
444
|
+
ownerId: channelInfo?.ownerId
|
|
510
445
|
};
|
|
511
446
|
}
|
|
512
447
|
async function resolveDiscordThreadParentInfo(params) {
|
|
513
448
|
const { threadChannel, channelInfo, client } = params;
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
if (!parentId && threadChannel.id) parentId = (await resolveDiscordChannelInfo(client, threadChannel.id))?.parentId ?? void 0;
|
|
449
|
+
let parentId = threadChannel.parentId ?? channelInfo?.parentId;
|
|
450
|
+
if (!parentId && threadChannel.id) parentId = (await resolveDiscordChannelInfo(client, threadChannel.id))?.parentId;
|
|
517
451
|
if (!parentId) return {};
|
|
518
|
-
let parentName = resolveDiscordChannelNameSafe(parent);
|
|
519
452
|
const parentInfo = await resolveDiscordChannelInfo(client, parentId);
|
|
520
|
-
parentName =
|
|
453
|
+
const parentName = parentInfo?.name;
|
|
521
454
|
const parentType = parentInfo?.type;
|
|
522
455
|
return {
|
|
523
456
|
id: parentId,
|
|
@@ -538,7 +471,7 @@ async function resolveDiscordThreadStarter(params) {
|
|
|
538
471
|
try {
|
|
539
472
|
return await pending;
|
|
540
473
|
} finally {
|
|
541
|
-
|
|
474
|
+
IN_FLIGHT_DISCORD_THREAD_STARTERS.delete(cacheKey);
|
|
542
475
|
}
|
|
543
476
|
}
|
|
544
477
|
async function resolveDiscordThreadStarterUncached(params, cacheKey, messageChannelId) {
|
|
@@ -577,7 +510,7 @@ function buildDiscordThreadStarterPayload(params) {
|
|
|
577
510
|
authorName: starter.author?.username ?? void 0,
|
|
578
511
|
authorTag,
|
|
579
512
|
memberRoleIds: Array.isArray(starter.member?.roles) ? starter.member.roles : void 0,
|
|
580
|
-
timestamp: params.resolveTimestampMs(starter.timestamp)
|
|
513
|
+
timestamp: params.resolveTimestampMs(starter.timestamp)
|
|
581
514
|
};
|
|
582
515
|
}
|
|
583
516
|
function resolveDiscordThreadStarterAuthorTag(author) {
|
|
@@ -613,12 +546,12 @@ function resolveDiscordReplyDeliveryPlan(params) {
|
|
|
613
546
|
// extensions/discord/src/monitor/thread-channel-context.ts
|
|
614
547
|
async function resolveDiscordThreadLikeChannelContext(params) {
|
|
615
548
|
const safeChannelInfo = resolveDiscordChannelInfoSafe(params.channel);
|
|
616
|
-
const channelId =
|
|
549
|
+
const channelId = safeChannelInfo.id ?? params.channelIdFallback ?? "";
|
|
617
550
|
const channelInfo = params.channelInfo !== void 0 ? params.channelInfo : channelId ? await resolveDiscordChannelInfo(params.client, channelId) : null;
|
|
618
551
|
const channelType = safeChannelInfo.type ?? channelInfo?.type;
|
|
619
552
|
const channelName = safeChannelInfo.name ?? channelInfo?.name;
|
|
620
553
|
const channelSlug = channelName ? normalizeDiscordSlug(channelName) : "";
|
|
621
|
-
const parentId =
|
|
554
|
+
const parentId = safeChannelInfo.parentId ?? channelInfo?.parentId;
|
|
622
555
|
const isThreadChannel = isDiscordThreadChannelType(channelType);
|
|
623
556
|
let threadParentId;
|
|
624
557
|
let threadParentName;
|
|
@@ -629,8 +562,7 @@ async function resolveDiscordThreadLikeChannelContext(params) {
|
|
|
629
562
|
threadChannel: {
|
|
630
563
|
id: channelId,
|
|
631
564
|
name: channelName,
|
|
632
|
-
parentId
|
|
633
|
-
parent: void 0
|
|
565
|
+
parentId
|
|
634
566
|
},
|
|
635
567
|
channelInfo
|
|
636
568
|
});
|
|
@@ -647,8 +579,7 @@ async function resolveDiscordThreadLikeChannelContext(params) {
|
|
|
647
579
|
parentId,
|
|
648
580
|
threadParentId,
|
|
649
581
|
threadParentName,
|
|
650
|
-
threadParentSlug
|
|
651
|
-
channelInfo
|
|
582
|
+
threadParentSlug
|
|
652
583
|
};
|
|
653
584
|
}
|
|
654
585
|
async function resolveFetchedDiscordThreadLikeChannelContext(params) {
|
|
@@ -657,11 +588,6 @@ async function resolveFetchedDiscordThreadLikeChannelContext(params) {
|
|
|
657
588
|
channelInfo: buildDiscordChannelInfo(params.channel)
|
|
658
589
|
});
|
|
659
590
|
}
|
|
660
|
-
// extensions/discord/src/voice/config.ts
|
|
661
|
-
function resolveDiscordVoiceEnabled(voice) {
|
|
662
|
-
if (voice?.enabled !== void 0) return voice.enabled;
|
|
663
|
-
return voice !== void 0;
|
|
664
|
-
}
|
|
665
591
|
// extensions/discord/src/voice/owner-access.ts
|
|
666
592
|
async function resolveDiscordVoiceAccessTarget(params) {
|
|
667
593
|
const [guild, channel] = await Promise.all([params.client.fetchGuild(params.guildId).catch(() => null), params.client.fetchChannel(params.channelId).catch(() => null)]);
|
|
@@ -768,6 +694,11 @@ async function authorizeDiscordVoiceIngress(initialParams) {
|
|
|
768
694
|
message: "You are not authorized to use this command."
|
|
769
695
|
};
|
|
770
696
|
}
|
|
697
|
+
// extensions/discord/src/voice/config.ts
|
|
698
|
+
function resolveDiscordVoiceEnabled(voice) {
|
|
699
|
+
if (voice?.enabled !== void 0) return voice.enabled;
|
|
700
|
+
return voice !== void 0;
|
|
701
|
+
}
|
|
771
702
|
// extensions/discord/src/voice/transcripts-source.ts
|
|
772
703
|
const TRANSCRIPTS_STATE = resolveGlobalSingleton(Symbol.for("openclaw.discordTranscriptsState"), () => ({
|
|
773
704
|
managersByAccountId: /* @__PURE__ */ new Map(),
|
|
@@ -953,8 +884,7 @@ async function waitForManager(request) {
|
|
|
953
884
|
resolve();
|
|
954
885
|
}
|
|
955
886
|
};
|
|
956
|
-
const timer = setTimeout(waiter.resolve, startupWaitMs);
|
|
957
|
-
timer.unref?.();
|
|
887
|
+
const timer = setTimeout(waiter.resolve, startupWaitMs).unref();
|
|
958
888
|
request.abortSignal?.addEventListener("abort", waiter.resolve, { once: true });
|
|
959
889
|
managerWaiters.add(waiter);
|
|
960
890
|
});
|
|
@@ -1234,4 +1164,4 @@ const discordVoiceTranscriptsSourceProvider = {
|
|
|
1234
1164
|
}));
|
|
1235
1165
|
}
|
|
1236
1166
|
};
|
|
1237
|
-
export { resolveDiscordChannelInfo as A, resolveMediaList as C, resolveDiscordMessageStickers as D, hasDiscordMessageStickers as E, resolveDiscordReferencedReplyMessage as O, resolveForwardedMediaList as S, resolveDiscordCdnPolicy as T, resolveDiscordMessageBatch as _,
|
|
1167
|
+
export { resolveDiscordChannelInfo as A, resolveMediaList as C, resolveDiscordMessageStickers as D, hasDiscordMessageStickers as E, resolveDiscordReferencedReplyMessage as O, resolveForwardedMediaList as S, resolveDiscordCdnPolicy as T, resolveDiscordMessageBatch as _, resolveDiscordVoiceEnabled as a, resolveDiscordMessageText as b, resolveDiscordVoiceAccessTarget as c, resolveDiscordReplyDeliveryPlan as d, resolveDiscordReplyTarget as f, sanitizeDiscordThreadName as g, resolveDiscordThreadStarter as h, setDiscordTranscriptsVoiceManager as i, resolveDiscordMessageChannelId as j, resolveDiscordReferencedReplyMessageId as k, resolveDiscordThreadLikeChannelContext as l, resolveDiscordThreadParentInfo as m, discordVoiceTranscriptsSourceProvider as n, authorizeDiscordVoiceIngress as o, resolveDiscordThreadChannel as p, resolveDiscordTranscriptsCapture as r, resolveDiscordVoiceAccess as s, bindDiscordCaptureReceipts as t, resolveFetchedDiscordThreadLikeChannelContext as u, resolveDiscordMessageHistoryText as v, resolveReferencedReplyMediaList as w, formatDiscordMediaText as x, resolveDiscordMessageMentionDocuments as y };
|