@openclaw/discord 2026.8.1-beta.3 → 2026.8.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/{account-inspect-D5xmUpnj.js → account-inspect-BDfKyuvL.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-DNl-oCEw.js → accounts-CfQ-vSyf.js} +5 -124
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-KCBAmWxD.js → activities-api-Dl-TOyOX.js} +5 -4
- package/dist/activities-api.js +1 -1
- package/dist/api.js +16 -16
- package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-q4Zqo44V.js} +28 -105
- package/dist/{audit-Yc7eZDd6.js → audit-DgrvFPGt.js} +5 -5
- package/dist/{channel-cXYzGc4L.js → channel-BsQUalPw.js} +18 -20
- package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-UMGGIfSy.js} +59 -58
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel-type-CVLZyGYS.js +7 -0
- package/dist/{channel.setup-CSiwnMgs.js → channel.setup-rPs4dsk_.js} +5 -5
- package/dist/{components-ezGKo_Yh.js → components-Dk35LTf_.js} +33 -29
- package/dist/{config-schema-DC5kDtQ5.js → config-schema-CxPqtVI1.js} +16 -10
- package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-BjvX4e35.js} +1 -1
- package/dist/{directory-config-XyCfoqLg.js → directory-config-B7DY_pNG.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Df0NbFJB.js → directory-live-DuAXKkan.js} +2 -2
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{doctor-DYY31GrO.js → doctor-zQTtn6hm.js} +4 -4
- package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-DZewwLr1.js} +9 -5
- package/dist/index.js +1 -1
- package/dist/ingress-identity-CzZKcPK8.js +60 -0
- package/dist/{message-handler-B61q5MOF.js → message-handler-C5By3yl5.js} +5 -5
- package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-DrszWuHw.js} +20 -84
- package/dist/{message-handler.process--4_712Ec.js → message-handler.process-DyFPDLCt.js} +60 -66
- package/dist/{message-utils-BXLLnFl6.js → message-text-Ca8M6TU8.js} +34 -32
- package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Dif8p481.js} +58 -61
- package/dist/{outbound-components-B2PL0ooH.js → outbound-components-wjv7yyAj.js} +5 -4
- package/dist/outbound-session-route-Bn4uXaoE.js +665 -0
- package/dist/{owner-access-Bg41VzAf.js → owner-access-UlYi9t0M.js} +1 -1
- package/dist/{pluralkit-dUl4v1X3.js → pluralkit-9EuEN4UD.js} +1 -1
- package/dist/{probe-BTdtVRwU.js → probe-n6ZXxK8V.js} +1 -1
- package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-CN4bdPfZ.js} +1 -1
- package/dist/{provider-DlK_ynqt.js → provider-LXiOcJrH.js} +443 -295
- package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DSNe7r2W.js} +3 -3
- package/dist/provider.runtime-DiInaDXO.js +2 -0
- package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-DOViOIjY.js} +106 -122
- package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BLoYaxEG.js} +1 -1
- package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-D2yl_2CN.js} +4 -3
- package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BLxfqajZ.js} +2 -2
- package/dist/{retry-DNsVTeTo.js → retry-DqHCW6PV.js} +220 -6
- package/dist/{runtime-D71_VFLr.js → runtime-BYamRVPN.js} +73 -56
- package/dist/{runtime-CQovMsH3.js → runtime-DrxVBTtp.js} +2 -2
- package/dist/runtime-api.js +16 -23
- package/dist/{sdk-runtime-37OU6_Yh.js → sdk-runtime-6tfgYDjY.js} +55 -86
- package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
- package/dist/{send-rQIffSYu.js → send-UJHiAm4C.js} +78 -15
- package/dist/{send.components-ChK1wS7w.js → send.components-CrBJpGT_.js} +15 -22
- package/dist/{send.outbound-HIkgji_7.js → send.outbound-D7JYmfm9.js} +58 -69
- package/dist/{send.shared-B3fpaLWJ.js → send.shared-DZJ1akvQ.js} +36 -21
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CaAaoksy.js → shared-Dii2HTn7.js} +31 -9
- package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-JyGrtQIl.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-Nuwoq_au.js → system-events-BEmcj4xJ.js} +1 -1
- package/dist/{target-resolver-DIXShHaZ.js → target-resolver-V-IYae6s.js} +3 -3
- package/dist/targets-CQp53cGj.js +3 -0
- package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-DvYP79fy.js} +3 -4
- package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-Clm77DBM.js} +8 -12
- package/dist/{threading-DU6pgeGm.js → threading-CXuu_7o9.js} +47 -25
- package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-BLEMH_yi.js} +9 -4
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-oLiS5Z13.js → typing-B9snnwMe.js} +1 -1
- package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-DY6_o73o.js} +76 -66
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
- package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/discord-api-types/CHANGELOG.md +8 -0
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
- package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
- package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
- package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
- package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
- package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
- package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/node_modules/undici/docs/docs/api/Client.md +21 -8
- package/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
- package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
- package/node_modules/undici/lib/dispatcher/client.js +74 -29
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
- package/node_modules/undici/lib/handler/retry-handler.js +7 -2
- package/node_modules/undici/lib/interceptor/cache.js +5 -2
- package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
- package/node_modules/undici/lib/mock/mock-utils.js +213 -24
- package/node_modules/undici/lib/util/cache.js +2 -4
- package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +40 -0
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +12 -4
- package/package.json +8 -8
- package/skills/discord/SKILL.md +1 -1
- package/dist/approval-message-safety-XGFPbDoI.js +0 -226
- package/dist/audit-core-BCX8UeFH.js +0 -105
- package/dist/channel-actions-Dr2QI8Bf.js +0 -212
- package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
- package/dist/provider.runtime-CzKGRiAF.js +0 -2
- package/dist/runtime-api.actions.js +0 -3
- package/dist/runtime-api.lookup.js +0 -7
- package/dist/runtime-api.monitor-CzeTYF32.js +0 -6
- package/dist/runtime-api.monitor.js +0 -9
- package/dist/runtime-api.send.js +0 -7
- package/dist/runtime-api.threads.js +0 -5
- package/dist/send.reactions-gmJ6yFPo.js +0 -78
- package/dist/send.receipt-Cnhoautb.js +0 -76
- package/dist/subagent-progress-FPLqBY1s.js +0 -110
- package/dist/targets-B2pf49zc.js +0 -3
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
package/dist/runtime-api.js
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-ChK1wS7w.js";
|
|
1
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-CrBJpGT_.js";
|
|
3
2
|
import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
4
|
-
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-DuAXKkan.js";
|
|
5
4
|
import { _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as resolveGroupDmAllow, y as shouldEmitDiscordReactionNotification } from "./allow-list-BDMimASD.js";
|
|
6
|
-
import { C as hasAllGuildPermissionsDiscord, G as
|
|
7
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
5
|
+
import { C as hasAllGuildPermissionsDiscord, G as unregisterGateway, H as clearGateways, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, U as getGateway, W as registerGateway, _ as DiscordSendError, x as fetchChannelPermissionsDiscord } from "./send.shared-DZJ1akvQ.js";
|
|
6
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-D7JYmfm9.js";
|
|
8
7
|
import { i as setPresence, n as getPresence, r as presenceCacheSize, t as clearPresences } from "./presence-cache-z1N8MbJ3.js";
|
|
9
|
-
import { A as
|
|
8
|
+
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, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-UJHiAm4C.js";
|
|
10
9
|
import { a as isAbortError, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, l as runDiscordTaskWithTimeout, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as normalizeDiscordInboundWorkerTimeoutMs, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordListenerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
11
|
-
import { i as
|
|
12
|
-
import {
|
|
13
|
-
import { t as discordMessageActions } from "./channel-actions-Dr2QI8Bf.js";
|
|
10
|
+
import { c as readDiscordChannelMoveParams, i as requiredGuildPermissionForModerationAction, l as readDiscordParentIdParam, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-BYamRVPN.js";
|
|
11
|
+
import { p as discordMessageActions, t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-Bn4uXaoE.js";
|
|
14
12
|
import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-D8OMdk4O.js";
|
|
15
13
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CJb-BpPL.js";
|
|
16
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
17
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
18
|
-
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
19
|
-
import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-
|
|
20
|
-
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
21
|
-
import "./
|
|
22
|
-
import {
|
|
23
|
-
import "./
|
|
24
|
-
import {
|
|
25
|
-
import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-DU6pgeGm.js";
|
|
26
|
-
import { t as createDiscordMessageHandler } from "./message-handler-B61q5MOF.js";
|
|
27
|
-
import "./runtime-api.monitor-CzeTYF32.js";
|
|
28
|
-
import "./runtime-api.send.js";
|
|
29
|
-
import "./runtime-api.threads.js";
|
|
14
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-D2yl_2CN.js";
|
|
15
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BLxfqajZ.js";
|
|
16
|
+
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-Clm77DBM.js";
|
|
17
|
+
import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-DvYP79fy.js";
|
|
18
|
+
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-n6ZXxK8V.js";
|
|
19
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-DgrvFPGt.js";
|
|
20
|
+
import { d as resolveDiscordGatewayIntents, f as waitForDiscordGatewayPluginRegistration, p as createDiscordNativeCommand, t as monitorDiscordProvider, u as createDiscordGatewayPlugin, y as registerDiscordListener } from "./provider-LXiOcJrH.js";
|
|
21
|
+
import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-CXuu_7o9.js";
|
|
22
|
+
import { t as createDiscordMessageHandler } from "./message-handler-C5By3yl5.js";
|
|
30
23
|
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, clearGateways, clearPresences, collectDiscordAuditChannelIds, createChannelDiscord, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, createNoopThreadBindingManager, createScheduledEventDiscord, createThreadBindingManager, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, discordMessageActions, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, formatThreadBindingDurationLabel, getGateway, getPresence, getThreadBindingManager, handleDiscordAction, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, isAbortError, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, parseApplicationIdFromToken, pinMessageDiscord, presenceCacheSize, probeDiscord, reactMessageDiscord, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, readMessagesDiscord, reconcileAcpThreadBindingsOnStartup, registerBuiltDiscordComponentMessage, registerDiscordListener, registerGateway, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, requiredGuildPermissionForModerationAction, resolveDiscordChannelAllowlist, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordOutboundSessionRoute, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveDiscordUserAllowlist, resolveEventCoverImage, resolveGroupDmAllow, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as discord_exports } from "./retry-DqHCW6PV.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
@@ -99,29 +99,6 @@ function buildWavBuffer(pcm) {
|
|
|
99
99
|
header.writeUInt32LE(pcm.length, 40);
|
|
100
100
|
return Buffer.concat([header, pcm]);
|
|
101
101
|
}
|
|
102
|
-
async function createOpusDecoder(params) {
|
|
103
|
-
let decoder;
|
|
104
|
-
try {
|
|
105
|
-
decoder = await createDecoder({
|
|
106
|
-
channels: CHANNELS,
|
|
107
|
-
sampleRate: SAMPLE_RATE
|
|
108
|
-
});
|
|
109
|
-
} catch (err) {
|
|
110
|
-
const failure = formatErrorMessage(err);
|
|
111
|
-
if (!warnedOpusMissing) {
|
|
112
|
-
warnedOpusMissing = true;
|
|
113
|
-
params.onWarn(`discord voice: no usable opus decoder available (libopus-wasm: ${failure}); cannot decode voice audio`);
|
|
114
|
-
}
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
name: "libopus-wasm",
|
|
119
|
-
decoder: {
|
|
120
|
-
decode: (buffer) => pcmInt16ToBuffer(decoder.decode(buffer, { maxFrameSize: DISCORD_OPUS_FRAME_SIZE })),
|
|
121
|
-
free: () => decoder.free()
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
102
|
function createDiscordOpusEncodeStream() {
|
|
126
103
|
return new DiscordOpusEncodeStream();
|
|
127
104
|
}
|
|
@@ -185,99 +162,92 @@ function createDiscordOpusPlaybackStream(input) {
|
|
|
185
162
|
}
|
|
186
163
|
var DiscordOpusEncodeStream = class extends Transform {
|
|
187
164
|
#buffer = Buffer.alloc(0);
|
|
188
|
-
#encoder
|
|
189
|
-
#encoderPromise = null;
|
|
165
|
+
#encoder;
|
|
190
166
|
constructor() {
|
|
191
167
|
super({ readableObjectMode: true });
|
|
192
168
|
}
|
|
193
|
-
|
|
194
|
-
|
|
169
|
+
_construct(done) {
|
|
170
|
+
createEncoder({
|
|
195
171
|
application: Application.Audio,
|
|
196
172
|
channels: CHANNELS,
|
|
197
173
|
sampleRate: SAMPLE_RATE
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
|
|
174
|
+
}).then((encoder) => {
|
|
175
|
+
this.#encoder = encoder;
|
|
176
|
+
done();
|
|
177
|
+
}, (err) => done(err instanceof Error ? err : new Error(formatErrorMessage(err))));
|
|
201
178
|
}
|
|
202
179
|
_transform(chunk, _encoding, done) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
this.#buffer = this.#buffer.subarray(DISCORD_OPUS_FRAME_BYTES);
|
|
210
|
-
this.push(Buffer.from(encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
|
|
211
|
-
}
|
|
212
|
-
done();
|
|
213
|
-
} catch (err) {
|
|
214
|
-
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
180
|
+
try {
|
|
181
|
+
this.#buffer = this.#buffer.length > 0 ? Buffer.concat([this.#buffer, chunk]) : Buffer.from(chunk);
|
|
182
|
+
while (this.#buffer.length >= DISCORD_OPUS_FRAME_BYTES) {
|
|
183
|
+
const frame = this.#buffer.subarray(0, DISCORD_OPUS_FRAME_BYTES);
|
|
184
|
+
this.#buffer = this.#buffer.subarray(DISCORD_OPUS_FRAME_BYTES);
|
|
185
|
+
this.#encodeFrame(frame);
|
|
215
186
|
}
|
|
216
|
-
|
|
187
|
+
done();
|
|
188
|
+
} catch (err) {
|
|
189
|
+
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
190
|
+
}
|
|
217
191
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
this.#buffer = Buffer.alloc(0);
|
|
226
|
-
this.push(Buffer.from(encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
|
|
227
|
-
}
|
|
228
|
-
this.#freeEncoder();
|
|
229
|
-
done();
|
|
230
|
-
} catch (err) {
|
|
231
|
-
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
192
|
+
_flush(done) {
|
|
193
|
+
try {
|
|
194
|
+
if (this.#buffer.length > 0) {
|
|
195
|
+
const frame = Buffer.alloc(DISCORD_OPUS_FRAME_BYTES);
|
|
196
|
+
this.#buffer.copy(frame);
|
|
197
|
+
this.#buffer = Buffer.alloc(0);
|
|
198
|
+
this.#encodeFrame(frame);
|
|
232
199
|
}
|
|
233
|
-
|
|
200
|
+
done();
|
|
201
|
+
} catch (err) {
|
|
202
|
+
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
203
|
+
}
|
|
234
204
|
}
|
|
235
205
|
_destroy(err, done) {
|
|
236
|
-
this.#
|
|
206
|
+
this.#encoder?.free();
|
|
207
|
+
this.#buffer = Buffer.alloc(0);
|
|
237
208
|
done(err);
|
|
238
209
|
}
|
|
239
|
-
#
|
|
240
|
-
this.#encoder
|
|
241
|
-
this.#encoder = null;
|
|
210
|
+
#encodeFrame(frame) {
|
|
211
|
+
this.push(Buffer.from(this.#encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
|
|
242
212
|
}
|
|
243
213
|
};
|
|
244
214
|
function pcmInt16ToBuffer(pcm) {
|
|
245
215
|
return Buffer.from(pcm.buffer, pcm.byteOffset, pcm.byteLength);
|
|
246
216
|
}
|
|
247
217
|
async function decodeOpusStream(stream, params) {
|
|
248
|
-
const selected = await createOpusDecoder({ onWarn: params.onWarn });
|
|
249
|
-
if (!selected) return Buffer.alloc(0);
|
|
250
|
-
params.onVerbose(`opus decoder: ${selected.name}`);
|
|
251
218
|
const chunks = [];
|
|
219
|
+
await decodeOpusStreamChunks(stream, {
|
|
220
|
+
...params,
|
|
221
|
+
onChunk: (chunk) => chunks.push(chunk)
|
|
222
|
+
});
|
|
223
|
+
return Buffer.concat(chunks);
|
|
224
|
+
}
|
|
225
|
+
async function decodeOpusStreamChunks(stream, params) {
|
|
226
|
+
let decoder;
|
|
252
227
|
try {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
228
|
+
decoder = await createDecoder({
|
|
229
|
+
channels: CHANNELS,
|
|
230
|
+
sampleRate: SAMPLE_RATE
|
|
231
|
+
});
|
|
258
232
|
} catch (err) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
233
|
+
if (!warnedOpusMissing) {
|
|
234
|
+
warnedOpusMissing = true;
|
|
235
|
+
params.onWarn(`discord voice: no usable opus decoder available (libopus-wasm: ${formatErrorMessage(err)}); cannot decode voice audio`);
|
|
236
|
+
}
|
|
237
|
+
return;
|
|
263
238
|
}
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
async function decodeOpusStreamChunks(stream, params) {
|
|
267
|
-
const selected = await createOpusDecoder({ onWarn: params.onWarn });
|
|
268
|
-
if (!selected) return;
|
|
269
|
-
params.onVerbose(`opus decoder: ${selected.name}`);
|
|
239
|
+
params.onVerbose("opus decoder: libopus-wasm");
|
|
270
240
|
try {
|
|
271
241
|
for await (const chunk of stream) {
|
|
272
242
|
if (!chunk || !(chunk instanceof Buffer) || chunk.length === 0) continue;
|
|
273
|
-
const decoded =
|
|
274
|
-
if (decoded
|
|
243
|
+
const decoded = decoder.decode(chunk, { maxFrameSize: DISCORD_OPUS_FRAME_SIZE });
|
|
244
|
+
if (decoded.length > 0) params.onChunk(pcmInt16ToBuffer(decoded));
|
|
275
245
|
}
|
|
276
246
|
} catch (err) {
|
|
277
247
|
params.onError?.(err);
|
|
278
248
|
if (shouldLogVerbose()) logVerbose(`discord voice: opus decode failed: ${formatErrorMessage(err)}`);
|
|
279
249
|
} finally {
|
|
280
|
-
|
|
250
|
+
decoder.free();
|
|
281
251
|
}
|
|
282
252
|
}
|
|
283
253
|
function convertDiscordPcm48kStereoToRealtimePcm24kMono(pcm) {
|
|
@@ -338,7 +308,6 @@ const CAPTURE_FINALIZE_GRACE_MS = 2e3;
|
|
|
338
308
|
const VOICE_CONNECT_READY_TIMEOUT_MS = 3e4;
|
|
339
309
|
const VOICE_RECONNECT_GRACE_MS = 15e3;
|
|
340
310
|
const PLAYBACK_READY_TIMEOUT_MS = 6e4;
|
|
341
|
-
const SPEAKING_READY_TIMEOUT_MS = 6e4;
|
|
342
311
|
function resolveVoiceTimeoutMs(value, fallbackMs) {
|
|
343
312
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return fallbackMs;
|
|
344
313
|
return Math.floor(value);
|
|
@@ -366,4 +335,4 @@ function loadDiscordVoiceSdk() {
|
|
|
366
335
|
return cachedDiscordVoiceSdk;
|
|
367
336
|
}
|
|
368
337
|
//#endregion
|
|
369
|
-
export {
|
|
338
|
+
export { decodeOpusStreamChunks as _, VOICE_CONNECT_READY_TIMEOUT_MS as a, maybeControlDiscordVoiceAgentRun as b, isVoiceChannel as c, resolveVoiceTimeoutMs as d, convertDiscordPcm48kStereoToRealtimePcm24kMono as f, decodeOpusStream as g, createDiscordOpusPlaybackStream as h, PLAYBACK_READY_TIMEOUT_MS as i, logVoiceVerbose as l, createDiscordOpusEncodeStream as m, CAPTURE_FINALIZE_GRACE_MS as n, VOICE_RECONNECT_GRACE_MS as o, convertRealtimePcm24kMonoToDiscordPcm48kStereo as p, MIN_SEGMENT_SECONDS as r, isDiscordRealtimeVoiceMode as s, loadDiscordVoiceSdk as t, resolveDiscordVoiceMode as u, writeVoiceWavFile as v, formatVoiceLogPreview as x, formatVoiceIngressPrompt as y };
|
|
@@ -32,12 +32,8 @@ function listBroadMemberTargetPaths(params) {
|
|
|
32
32
|
}
|
|
33
33
|
function addDiscordNameBasedEntries(params) {
|
|
34
34
|
if (!Array.isArray(params.values)) return;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const text = normalizeOptionalString(String(value)) ?? "";
|
|
38
|
-
if (!text) continue;
|
|
39
|
-
params.target.add(`${params.source}:${text}`);
|
|
40
|
-
}
|
|
35
|
+
const entries = new Set(params.values.map((value) => String(value).trim()).filter(isDiscordMutableAllowEntry));
|
|
36
|
+
if (entries.size > 0) params.target.set(params.source, entries.size);
|
|
41
37
|
}
|
|
42
38
|
async function collectDiscordSecurityAuditFindings(params) {
|
|
43
39
|
const findings = [];
|
|
@@ -45,7 +41,7 @@ async function collectDiscordSecurityAuditFindings(params) {
|
|
|
45
41
|
const accountId = normalizeOptionalString(params.accountId) ?? params.account.accountId ?? "default";
|
|
46
42
|
const dangerousNameMatchingEnabled = isDangerousNameMatchingEnabled(discordCfg);
|
|
47
43
|
const storeAllowFrom = await readChannelAllowFromStore("discord", process.env, accountId).catch(() => []);
|
|
48
|
-
const discordNameBasedAllowEntries = /* @__PURE__ */ new
|
|
44
|
+
const discordNameBasedAllowEntries = /* @__PURE__ */ new Map();
|
|
49
45
|
const discordPathPrefix = params.orderedAccountIds.length > 1 || params.hasExplicitAccountPath ? `channels.discord.accounts.${accountId}` : "channels.discord";
|
|
50
46
|
if ((discordCfg.groupPolicy ?? params.cfg.channels?.defaults?.groupPolicy ?? "allowlist") === "allowlist") {
|
|
51
47
|
const broadMemberPaths = listBroadMemberTargetPaths({
|
|
@@ -73,7 +69,7 @@ async function collectDiscordSecurityAuditFindings(params) {
|
|
|
73
69
|
addDiscordNameBasedEntries({
|
|
74
70
|
target: discordNameBasedAllowEntries,
|
|
75
71
|
values: storeAllowFrom,
|
|
76
|
-
source: "
|
|
72
|
+
source: "Discord pairing store"
|
|
77
73
|
});
|
|
78
74
|
const guildEntries = discordCfg.guilds ?? {};
|
|
79
75
|
for (const [guildKey, guildValue] of Object.entries(guildEntries)) {
|
|
@@ -96,13 +92,16 @@ async function collectDiscordSecurityAuditFindings(params) {
|
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
if (discordNameBasedAllowEntries.size > 0) {
|
|
99
|
-
const
|
|
100
|
-
const
|
|
95
|
+
const counts = Array.from(discordNameBasedAllowEntries);
|
|
96
|
+
const entryCount = counts.reduce((total, [, count]) => total + count, 0);
|
|
97
|
+
const sources = counts.slice(0, 5).map(([source, count]) => `${source} (${count})`);
|
|
98
|
+
const more = counts.length > sources.length ? ` (+${counts.length - sources.length} more sources)` : "";
|
|
99
|
+
const summary = `Found ${entryCount} name/tag entries: ${sources.join(", ")}${more}.`;
|
|
101
100
|
findings.push({
|
|
102
101
|
checkId: "channels.discord.allowFrom.name_based_entries",
|
|
103
102
|
severity: dangerousNameMatchingEnabled ? "info" : "warn",
|
|
104
103
|
title: dangerousNameMatchingEnabled ? "Discord allowlist uses break-glass name/tag matching" : "Discord allowlist contains name or tag entries",
|
|
105
|
-
detail: dangerousNameMatchingEnabled ?
|
|
104
|
+
detail: dangerousNameMatchingEnabled ? "Discord name/tag allowlist matching is explicitly enabled via dangerouslyAllowNameMatching. This mutable-identity mode is operator-selected break-glass behavior and out-of-scope for vulnerability reports by itself. " + summary : "Discord name/tag allowlist matching uses normalized slugs and can collide across users. " + summary,
|
|
106
105
|
remediation: dangerousNameMatchingEnabled ? "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>), then disable dangerouslyAllowNameMatching." : "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>) in channels.discord.allowFrom and channels.discord.guilds.*.users, or explicitly opt in with dangerouslyAllowNameMatching=true if you accept the risk."
|
|
107
106
|
});
|
|
108
107
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
1
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DKfK-iPY.js";
|
|
2
2
|
export { collectDiscordSecurityAuditFindings };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
1
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DKfK-iPY.js";
|
|
2
2
|
export { collectDiscordSecurityAuditFindings };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { $t as
|
|
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-DqHCW6PV.js";
|
|
2
2
|
import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-DdLPmPoa.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as sendPollDiscord, o as rewriteDiscordKnownMentions, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-HIkgji_7.js";
|
|
6
|
-
import { r as createDiscordSendResult } from "./send.receipt-Cnhoautb.js";
|
|
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-DZJ1akvQ.js";
|
|
4
|
+
import { n as sendPollDiscord, o as rewriteDiscordKnownMentions, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-D7JYmfm9.js";
|
|
7
5
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
8
|
-
import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-gmJ6yFPo.js";
|
|
9
6
|
import fs from "node:fs/promises";
|
|
10
7
|
import { ChannelType } from "discord-api-types/v10";
|
|
11
8
|
import crypto from "node:crypto";
|
|
@@ -763,7 +760,7 @@ async function uploadVoiceAttachment(params) {
|
|
|
763
760
|
* 2. Upload the OGG file to the provided URL
|
|
764
761
|
* 3. Send the message with flag 8192 and attachment metadata
|
|
765
762
|
*/
|
|
766
|
-
async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, replyTo, request, silent, token) {
|
|
763
|
+
async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, replyTo, request, silent, token, onPlatformSendDispatch) {
|
|
767
764
|
const filename = "voice-message.ogg";
|
|
768
765
|
const fileSize = audioBuffer.byteLength;
|
|
769
766
|
const botToken = token;
|
|
@@ -803,6 +800,7 @@ async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, r
|
|
|
803
800
|
let messageCreateMayHaveCommitted = false;
|
|
804
801
|
try {
|
|
805
802
|
return await request(async () => {
|
|
803
|
+
await onPlatformSendDispatch?.();
|
|
806
804
|
try {
|
|
807
805
|
return await rest.post(`/channels/${channelId}/messages`, { body: messagePayload });
|
|
808
806
|
} catch (error) {
|
|
@@ -859,10 +857,6 @@ async function sendVoiceMessageDiscord(to, audioPath, opts) {
|
|
|
859
857
|
let rest;
|
|
860
858
|
let channelId;
|
|
861
859
|
try {
|
|
862
|
-
const accountInfo = resolveDiscordAccount({
|
|
863
|
-
cfg,
|
|
864
|
-
accountId: opts.accountId
|
|
865
|
-
});
|
|
866
860
|
const client = createDiscordClient({
|
|
867
861
|
...opts,
|
|
868
862
|
cfg
|
|
@@ -870,15 +864,15 @@ async function sendVoiceMessageDiscord(to, audioPath, opts) {
|
|
|
870
864
|
token = client.token;
|
|
871
865
|
rest = client.rest;
|
|
872
866
|
const request = client.request;
|
|
873
|
-
const
|
|
867
|
+
const accountInfo = client.account;
|
|
868
|
+
const recipient = await parseAndResolveChannelRecipient(to, cfg, accountInfo.accountId);
|
|
874
869
|
channelId = (await resolveChannelId(rest, recipient, request)).channelId;
|
|
875
870
|
const ogg = await ensureOggOpus(localInputPath);
|
|
876
871
|
oggPath = ogg.path;
|
|
877
872
|
oggCleanup = ogg.cleanup;
|
|
878
873
|
const metadata = await getVoiceMessageMetadata(oggPath);
|
|
879
874
|
const audioBuffer = await fs.readFile(oggPath);
|
|
880
|
-
await opts.onPlatformSendDispatch
|
|
881
|
-
const result = await sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, opts.reply?.messageId, request, opts.silent, token);
|
|
875
|
+
const result = await sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, opts.reply?.messageId, request, opts.silent, token, opts.onPlatformSendDispatch);
|
|
882
876
|
recordChannelActivity({
|
|
883
877
|
channel: "discord",
|
|
884
878
|
accountId: accountInfo.accountId,
|
|
@@ -909,6 +903,75 @@ async function sendTypingDiscord(channelId, opts) {
|
|
|
909
903
|
};
|
|
910
904
|
}
|
|
911
905
|
//#endregion
|
|
906
|
+
//#region extensions/discord/src/send.reactions.ts
|
|
907
|
+
function resolveDiscordReactionClient(opts) {
|
|
908
|
+
if (opts.rest && opts.cfg && opts.accountId) return createDiscordClient(opts);
|
|
909
|
+
if (!opts.cfg) throw new Error("Discord reactions requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
|
|
910
|
+
const cfg = requireRuntimeConfig(opts.cfg, "Discord reactions");
|
|
911
|
+
return createDiscordClient({
|
|
912
|
+
...opts,
|
|
913
|
+
cfg
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
async function reactMessageDiscord(channelId, messageId, emoji, opts) {
|
|
917
|
+
const { rest, request } = resolveDiscordReactionClient(opts);
|
|
918
|
+
const encoded = normalizeReactionEmoji(emoji);
|
|
919
|
+
await request(() => createOwnMessageReaction(rest, channelId, messageId, encoded), "react");
|
|
920
|
+
return { ok: true };
|
|
921
|
+
}
|
|
922
|
+
async function removeReactionDiscord(channelId, messageId, emoji, opts) {
|
|
923
|
+
const { rest, request } = resolveDiscordReactionClient(opts);
|
|
924
|
+
const encoded = normalizeReactionEmoji(emoji);
|
|
925
|
+
await request(() => deleteOwnMessageReaction(rest, channelId, messageId, encoded), "reaction-remove");
|
|
926
|
+
return { ok: true };
|
|
927
|
+
}
|
|
928
|
+
async function removeOwnReactionsDiscord(channelId, messageId, opts) {
|
|
929
|
+
const { rest, request } = resolveDiscordReactionClient(opts);
|
|
930
|
+
const message = await request(() => getChannelMessage(rest, channelId, messageId), "reaction-list");
|
|
931
|
+
const identifiers = /* @__PURE__ */ new Set();
|
|
932
|
+
for (const reaction of message.reactions ?? []) {
|
|
933
|
+
const identifier = reaction.me ? buildReactionIdentifier(reaction.emoji) : void 0;
|
|
934
|
+
if (identifier) identifiers.add(identifier);
|
|
935
|
+
}
|
|
936
|
+
if (identifiers.size === 0) return {
|
|
937
|
+
ok: true,
|
|
938
|
+
removed: []
|
|
939
|
+
};
|
|
940
|
+
const removed = Array.from(identifiers);
|
|
941
|
+
await Promise.all(removed.map((identifier) => request(() => deleteOwnMessageReaction(rest, channelId, messageId, normalizeReactionEmoji(identifier)), "reaction-remove")));
|
|
942
|
+
return {
|
|
943
|
+
ok: true,
|
|
944
|
+
removed
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
async function fetchReactionsDiscord(channelId, messageId, opts) {
|
|
948
|
+
const { rest, request } = resolveDiscordReactionClient(opts);
|
|
949
|
+
const reactions = (await request(() => getChannelMessage(rest, channelId, messageId), "reaction-list")).reactions ?? [];
|
|
950
|
+
if (reactions.length === 0) return [];
|
|
951
|
+
const limit = typeof opts.limit === "number" && Number.isFinite(opts.limit) ? Math.min(Math.max(Math.floor(opts.limit), 1), 100) : 100;
|
|
952
|
+
const summaries = [];
|
|
953
|
+
for (const reaction of reactions) {
|
|
954
|
+
const identifier = buildReactionIdentifier(reaction.emoji);
|
|
955
|
+
if (!identifier) continue;
|
|
956
|
+
const encoded = encodeURIComponent(identifier);
|
|
957
|
+
const users = await request(() => listMessageReactionUsers(rest, channelId, messageId, encoded, { limit }), "reaction-users");
|
|
958
|
+
summaries.push({
|
|
959
|
+
emoji: {
|
|
960
|
+
id: reaction.emoji.id ?? null,
|
|
961
|
+
name: reaction.emoji.name ?? null,
|
|
962
|
+
raw: formatReactionEmoji(reaction.emoji)
|
|
963
|
+
},
|
|
964
|
+
count: reaction.count,
|
|
965
|
+
users: users.map((user) => ({
|
|
966
|
+
id: user.id,
|
|
967
|
+
username: user.username,
|
|
968
|
+
tag: user.username && user.discriminator ? `${user.username}#${user.discriminator}` : user.username
|
|
969
|
+
}))
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
return summaries;
|
|
973
|
+
}
|
|
974
|
+
//#endregion
|
|
912
975
|
//#region extensions/discord/src/send.ts
|
|
913
976
|
var send_exports = /* @__PURE__ */ __exportAll({
|
|
914
977
|
DiscordSendError: () => DiscordSendError,
|
|
@@ -966,4 +1029,4 @@ var send_exports = /* @__PURE__ */ __exportAll({
|
|
|
966
1029
|
uploadStickerDiscord: () => uploadStickerDiscord
|
|
967
1030
|
});
|
|
968
1031
|
//#endregion
|
|
969
|
-
export {
|
|
1032
|
+
export { listScheduledEventsDiscord as A, moveChannelDiscord as B, fetchChannelInfoDiscord as C, fetchVoiceStatusDiscord as D, fetchRoleInfoDiscord as E, uploadEmojiDiscord as F, setChannelPermissionDiscord as H, uploadStickerDiscord as I, createChannelDiscord as L, resolveEventCoverImage as M, timeoutMemberDiscord as N, kickMemberDiscord as O, listGuildEmojisDiscord as P, deleteChannelDiscord as R, createScheduledEventDiscord as S, fetchMemberInfoDiscord as T, removeChannelPermissionDiscord as V, readMessagesDiscord as _, removeReactionDiscord as a, addRoleDiscord as b, sendWebhookMessageDiscord as c, deleteMessageDiscord as d, editMessageDiscord as f, pinMessageDiscord as g, listThreadsDiscord as h, removeOwnReactionsDiscord as i, removeRoleDiscord as j, listGuildChannelsDiscord as k, DiscordThreadInitialMessageError as l, listPinsDiscord as m, fetchReactionsDiscord as n, sendTypingDiscord as o, fetchMessageDiscord as p, reactMessageDiscord as r, sendVoiceMessageDiscord as s, send_exports as t, createThreadDiscord as u, searchMessagesDiscord as v, fetchGuildInfoDiscord as w, banMemberDiscord as x, unpinMessageDiscord as y, editChannelDiscord as z };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags,
|
|
3
|
-
import { c as resolveDiscordAccount, y as loadOutboundMediaFromUrl } from "./accounts-DNl-oCEw.js";
|
|
1
|
+
import { c as createDiscordSendResult, kt as editChannelMessage, on as __exportAll, q as serializePayload, wt as createChannelMessage } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName } from "./components-Dk35LTf_.js";
|
|
4
3
|
import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
5
|
-
import {
|
|
6
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
7
|
-
import { r as createDiscordSendResult } from "./send.receipt-Cnhoautb.js";
|
|
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-DZJ1akvQ.js";
|
|
5
|
+
import { t as sendMessageDiscord } from "./send.outbound-D7JYmfm9.js";
|
|
8
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
9
7
|
import { asDateTimestampMs, isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
10
8
|
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
9
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
12
10
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
11
|
+
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
13
12
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
14
13
|
import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
15
14
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
@@ -364,7 +363,7 @@ async function buildDiscordComponentPayload(params) {
|
|
|
364
363
|
});
|
|
365
364
|
const filenameOverride = params.opts.filename?.trim();
|
|
366
365
|
const explicitAttachmentName = extractComponentAttachmentNames(spec)[0];
|
|
367
|
-
resolvedFileName = filenameOverride || media.fileName ||
|
|
366
|
+
resolvedFileName = filenameOverride || explicitAttachmentName || media.fileName || `upload${extensionForMime(media.contentType) ?? ""}`;
|
|
368
367
|
spec = withImplicitComponentAttachmentBlock(spec, resolvedFileName);
|
|
369
368
|
files = [{
|
|
370
369
|
data: media.buffer,
|
|
@@ -406,7 +405,7 @@ async function sendDiscordComponentMessage(to, spec, opts) {
|
|
|
406
405
|
token: opts.token,
|
|
407
406
|
rest: opts.rest,
|
|
408
407
|
mediaUrl: opts.mediaUrl,
|
|
409
|
-
filename: opts.filename,
|
|
408
|
+
filename: opts.filename?.trim() || extractComponentAttachmentNames(spec)[0],
|
|
410
409
|
mediaLocalRoots: opts.mediaLocalRoots,
|
|
411
410
|
mediaReadFile: opts.mediaReadFile,
|
|
412
411
|
mediaAccess: opts.mediaAccess,
|
|
@@ -421,15 +420,11 @@ async function sendDiscordComponentMessage(to, spec, opts) {
|
|
|
421
420
|
...opts.suppressEmbeds === void 0 ? {} : { suppressEmbeds: opts.suppressEmbeds }
|
|
422
421
|
});
|
|
423
422
|
const cfg = requireRuntimeConfig(opts.cfg, "Discord component send");
|
|
424
|
-
const accountInfo =
|
|
425
|
-
cfg,
|
|
426
|
-
accountId: opts.accountId
|
|
427
|
-
});
|
|
428
|
-
const { token, rest, request } = createDiscordClient({
|
|
423
|
+
const { token, rest, request, account: accountInfo } = createDiscordClient({
|
|
429
424
|
...opts,
|
|
430
425
|
cfg
|
|
431
426
|
});
|
|
432
|
-
const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg,
|
|
427
|
+
const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, accountInfo.accountId), request);
|
|
433
428
|
const channel = await resolveDiscordChannel(rest, channelId);
|
|
434
429
|
if (channel && DISCORD_FORUM_LIKE_TYPES.has(channel.type)) throw new Error("Discord components are not supported in forum-style channels");
|
|
435
430
|
const { body: componentBody, buildResult } = await buildDiscordComponentPayload({
|
|
@@ -444,8 +439,10 @@ async function sendDiscordComponentMessage(to, spec, opts) {
|
|
|
444
439
|
};
|
|
445
440
|
let result;
|
|
446
441
|
try {
|
|
447
|
-
await
|
|
448
|
-
|
|
442
|
+
result = await request(async () => {
|
|
443
|
+
await opts.onPlatformSendDispatch?.();
|
|
444
|
+
return createChannelMessage(rest, channelId, { body });
|
|
445
|
+
}, "components", { safety: "nonce-protected-create" });
|
|
449
446
|
} catch (err) {
|
|
450
447
|
throw await buildDiscordSendError(err, {
|
|
451
448
|
channelId,
|
|
@@ -476,15 +473,11 @@ async function sendDiscordComponentMessage(to, spec, opts) {
|
|
|
476
473
|
}
|
|
477
474
|
async function editDiscordComponentMessage(to, messageId, spec, opts) {
|
|
478
475
|
const cfg = requireRuntimeConfig(opts.cfg, "Discord component edit");
|
|
479
|
-
const accountInfo =
|
|
480
|
-
cfg,
|
|
481
|
-
accountId: opts.accountId
|
|
482
|
-
});
|
|
483
|
-
const { token, rest, request } = createDiscordClient({
|
|
476
|
+
const { token, rest, request, account: accountInfo } = createDiscordClient({
|
|
484
477
|
...opts,
|
|
485
478
|
cfg
|
|
486
479
|
});
|
|
487
|
-
const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg,
|
|
480
|
+
const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, accountInfo.accountId), request);
|
|
488
481
|
const { body, buildResult } = await buildDiscordComponentPayload({
|
|
489
482
|
spec,
|
|
490
483
|
opts,
|