@openclaw/discord 2026.8.1-beta.3 → 2026.8.2
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-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-DNl-oCEw.js → accounts-CwJQoLjM.js} +87 -162
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-KCBAmWxD.js → activities-api-CkKcHUB6.js} +14 -12
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
- package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
- package/dist/api.js +18 -18
- package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-DZM6Kt1Z.js} +30 -106
- package/dist/{audit-Yc7eZDd6.js → audit-DIbQA4VT.js} +8 -7
- package/dist/{channel-cXYzGc4L.js → channel-CarzU3bg.js} +25 -25
- package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-B2wMqeVK.js} +60 -57
- 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-z_ewMVa9.js} +18 -18
- package/dist/{components-ezGKo_Yh.js → components-gvRA0oaI.js} +33 -29
- package/dist/{config-schema-DC5kDtQ5.js → config-schema-B797-Spt.js} +21 -14
- package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-DPpBRpYI.js} +1 -1
- package/dist/{directory-config-XyCfoqLg.js → directory-config-AA8wQx0D.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Df0NbFJB.js → directory-live-D_kFz_Fj.js} +4 -4
- package/dist/{doctor-DYY31GrO.js → doctor-QQTOkBfW.js} +5 -5
- package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
- package/dist/doctor-contract-api.js +4 -3
- package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-Cc88ZGon.js} +9 -5
- package/dist/index.js +1 -1
- package/dist/ingress-identity-BCzfPPYM.js +60 -0
- package/dist/{message-handler-B61q5MOF.js → message-handler-CAeEpqWo.js} +14 -10
- package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-CoKoE3dY.js} +32 -91
- package/dist/{message-handler.process--4_712Ec.js → message-handler.process-cdIJ_fDT.js} +99 -123
- package/dist/{message-utils-BXLLnFl6.js → message-text-C0K4-fkg.js} +41 -34
- package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Ch0At5Ra.js} +85 -78
- package/dist/{outbound-components-B2PL0ooH.js → outbound-components-Bnt_7x7r.js} +5 -4
- package/dist/outbound-session-route-CzzerX2K.js +668 -0
- package/dist/{owner-access-Bg41VzAf.js → owner-access-yc1sX7Gx.js} +7 -6
- package/dist/{pluralkit-dUl4v1X3.js → pluralkit-B3cUVI7i.js} +2 -2
- package/dist/{probe-BTdtVRwU.js → probe-3ovFAp3b.js} +3 -3
- package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-BckHn3cJ.js} +1 -1
- package/dist/{provider-DlK_ynqt.js → provider-CjI8BSzS.js} +511 -342
- package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DdKRMcE9.js} +3 -3
- package/dist/provider.runtime-Bo1WbLLr.js +2 -0
- package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-37IC-p5K.js} +110 -126
- package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
- package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-BexR2eUn.js} +6 -5
- package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BtXBCH5W.js} +5 -4
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{retry-DNsVTeTo.js → retry-t5RcEsPk.js} +237 -15
- package/dist/{runtime-CQovMsH3.js → runtime-BNlDfLwS.js} +2 -2
- package/dist/{runtime-D71_VFLr.js → runtime-DydyfxST.js} +182 -131
- package/dist/runtime-api.js +19 -26
- package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
- package/dist/secret-contract-api.js +1 -1
- 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-mTKSBdmZ.js} +149 -58
- package/dist/{send.components-ChK1wS7w.js → send.components-nsPnc7kK.js} +29 -30
- package/dist/{send.outbound-HIkgji_7.js → send.outbound-CaOs9Zy1.js} +87 -84
- package/dist/{send.shared-B3fpaLWJ.js → send.shared-BJHt0Vyf.js} +55 -33
- package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CaAaoksy.js → shared-BNesVA4P.js} +43 -18
- package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-IeZVPLGj.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-Nuwoq_au.js → system-events-Be5EJI3b.js} +2 -2
- package/dist/{target-resolver-DIXShHaZ.js → target-resolver-C0MnwEki.js} +6 -5
- package/dist/targets-DQSye1Rv.js +3 -0
- package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-wECUSIIG.js} +6 -6
- package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-B-3UHCc1.js} +31 -32
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
- package/dist/{threading-DU6pgeGm.js → threading-te5ADPQI.js} +51 -27
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-DkUhR7YK.js} +9 -4
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-oLiS5Z13.js → typing-DAwJF5VT.js} +2 -2
- package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-COyYYTDD.js} +418 -74
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
- 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 +41 -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 +14 -6
- package/package.json +8 -8
- package/skills/discord/SKILL.md +1 -1
- package/dist/account-inspect-D5xmUpnj.js +0 -89
- 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/sdk-runtime-37OU6_Yh.js +0 -369
- 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
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
5
|
-
import { a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, n as isDiscordGroupAllowedByPolicy, v as resolveGroupDmAllow } from "./allow-list-
|
|
6
|
-
import {
|
|
7
|
-
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
1
|
+
import { f as resolveDiscordReplyReference, u as createReusableDiscordReplyReference, v as resolveDiscordChannelId } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-gvRA0oaI.js";
|
|
3
|
+
import { o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-CwJQoLjM.js";
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-nsPnc7kK.js";
|
|
5
|
+
import { a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, n as isDiscordGroupAllowedByPolicy, v as resolveGroupDmAllow } from "./allow-list-C2JuH-R0.js";
|
|
6
|
+
import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-BJHt0Vyf.js";
|
|
7
|
+
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-CaOs9Zy1.js";
|
|
8
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
8
9
|
import { n as getPresence } from "./presence-cache-z1N8MbJ3.js";
|
|
9
|
-
import { A as
|
|
10
|
-
import
|
|
11
|
-
import "./targets-B2pf49zc.js";
|
|
10
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-mTKSBdmZ.js";
|
|
11
|
+
import "./targets-DQSye1Rv.js";
|
|
12
12
|
import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
|
|
13
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
14
|
import { asBoolean, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
15
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
16
|
+
import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
16
17
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
18
|
+
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
17
19
|
//#region extensions/discord/src/actions/runtime-deps.ts
|
|
18
20
|
const discordGuildActionRuntime = {
|
|
19
21
|
addRoleDiscord,
|
|
@@ -241,8 +243,7 @@ function readDiscordChannelType(value) {
|
|
|
241
243
|
return typeof type === "number" ? type : void 0;
|
|
242
244
|
}
|
|
243
245
|
function isDiscordThreadChannel(value) {
|
|
244
|
-
|
|
245
|
-
return type === 10 || type === 11 || type === 12;
|
|
246
|
+
return isDiscordThreadChannelType(readDiscordChannelType(value));
|
|
246
247
|
}
|
|
247
248
|
function isDiscordReadAncestryAllowed(params) {
|
|
248
249
|
for (const ancestor of params.target.ancestors) {
|
|
@@ -623,9 +624,6 @@ const guildAdminActionGuards = {
|
|
|
623
624
|
channelPermissionSet: channelPermissionGuard,
|
|
624
625
|
channelPermissionRemove: channelPermissionGuard
|
|
625
626
|
};
|
|
626
|
-
function isThreadChannelType(channelType) {
|
|
627
|
-
return channelType === ChannelType.GuildNewsThread || channelType === ChannelType.GuildPublicThread || channelType === ChannelType.GuildPrivateThread;
|
|
628
|
-
}
|
|
629
627
|
function isLockedThreadChannel(channel) {
|
|
630
628
|
if (!channel || typeof channel !== "object") return false;
|
|
631
629
|
return channel.thread_metadata?.locked === true;
|
|
@@ -658,7 +656,8 @@ async function resolveGuildAdminActionPermissions(params) {
|
|
|
658
656
|
cfg: params.cfg,
|
|
659
657
|
accountId: params.accountId
|
|
660
658
|
}));
|
|
661
|
-
|
|
659
|
+
const channelType = "type" in channel ? channel.type : void 0;
|
|
660
|
+
if (!isDiscordThreadChannelType(channelType)) return params.guard.permissions;
|
|
662
661
|
return params.values.archived === false && !("name" in params.values) && !("topic" in params.values) && !("position" in params.values) && !("parentId" in params.values) && !("clearParent" in params.values) && !("nsfw" in params.values) && !("rateLimitPerUser" in params.values) && !("locked" in params.values) && !("autoArchiveDuration" in params.values) && !isLockedThreadChannel(channel) ? [PermissionFlagsBits.ManageThreads, PermissionFlagsBits.SendMessagesInThreads] : [PermissionFlagsBits.ManageThreads];
|
|
663
662
|
}
|
|
664
663
|
async function verifySenderGuildAdminPermission(params) {
|
|
@@ -765,18 +764,32 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
765
764
|
if (!isActionEnabled("roleInfo")) throw new Error("Discord role info is disabled.");
|
|
766
765
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
767
766
|
await assertGuildMetadataReadAllowed(guildId);
|
|
767
|
+
const roles = await discordGuildActionRuntime.fetchRoleInfoDiscord(guildId, withOpts());
|
|
768
768
|
return jsonResult({
|
|
769
769
|
ok: true,
|
|
770
|
-
roles
|
|
770
|
+
roles
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
773
|
case "emojiList": {
|
|
774
774
|
if (!isActionEnabled("reactions")) throw new Error("Discord reactions are disabled.");
|
|
775
|
-
const guildId =
|
|
775
|
+
const guildId = await resolveGuildIdForGuildAdminAction({
|
|
776
|
+
values: params,
|
|
777
|
+
accountId,
|
|
778
|
+
cfg
|
|
779
|
+
});
|
|
780
|
+
if (!guildId) throw new Error("Discord emoji listing requires guildId or a server channel.");
|
|
776
781
|
await assertGuildMetadataReadAllowed(guildId);
|
|
782
|
+
const limit = Math.min(readPositiveIntegerParam(params, "limit") ?? 100, 100);
|
|
783
|
+
const fetchEmojis = async () => (await discordGuildActionRuntime.listGuildEmojisDiscord(guildId, withOpts())).flatMap(({ name, id, animated }) => name && id ? [{
|
|
784
|
+
name,
|
|
785
|
+
identifier: `${name}:${id}`,
|
|
786
|
+
...animated ? { animated } : {}
|
|
787
|
+
}] : []).toSorted((left, right) => left.name.localeCompare(right.name) || left.identifier.localeCompare(right.identifier));
|
|
788
|
+
const gateway = getGateway(accountId ?? resolveDefaultDiscordAccountId(cfg));
|
|
789
|
+
const emojis = gateway ? await gateway.fetchGuildEmojis(guildId, fetchEmojis) : await fetchEmojis();
|
|
777
790
|
return jsonResult({
|
|
778
791
|
ok: true,
|
|
779
|
-
emojis:
|
|
792
|
+
emojis: emojis.slice(0, limit)
|
|
780
793
|
});
|
|
781
794
|
}
|
|
782
795
|
case "emojiUpload": {
|
|
@@ -785,14 +798,15 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
785
798
|
const name = readStringParam(params, "name", { required: true });
|
|
786
799
|
const mediaUrl = readStringParam(params, "mediaUrl", { required: true });
|
|
787
800
|
const roleIds = readStringArrayParam(params, "roleIds");
|
|
801
|
+
const emoji = await discordGuildActionRuntime.uploadEmojiDiscord({
|
|
802
|
+
guildId,
|
|
803
|
+
name,
|
|
804
|
+
mediaUrl,
|
|
805
|
+
roleIds: roleIds?.length ? roleIds : void 0
|
|
806
|
+
}, withOpts());
|
|
788
807
|
return jsonResult({
|
|
789
808
|
ok: true,
|
|
790
|
-
emoji
|
|
791
|
-
guildId,
|
|
792
|
-
name,
|
|
793
|
-
mediaUrl,
|
|
794
|
-
roleIds: roleIds?.length ? roleIds : void 0
|
|
795
|
-
}, withOpts())
|
|
809
|
+
emoji
|
|
796
810
|
});
|
|
797
811
|
}
|
|
798
812
|
case "stickerUpload": {
|
|
@@ -802,15 +816,16 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
802
816
|
const description = readStringParam(params, "description", { required: true });
|
|
803
817
|
const tags = readStringParam(params, "tags", { required: true });
|
|
804
818
|
const mediaUrl = readStringParam(params, "mediaUrl", { required: true });
|
|
819
|
+
const sticker = await discordGuildActionRuntime.uploadStickerDiscord({
|
|
820
|
+
guildId,
|
|
821
|
+
name,
|
|
822
|
+
description,
|
|
823
|
+
tags,
|
|
824
|
+
mediaUrl
|
|
825
|
+
}, withOpts());
|
|
805
826
|
return jsonResult({
|
|
806
827
|
ok: true,
|
|
807
|
-
sticker
|
|
808
|
-
guildId,
|
|
809
|
-
name,
|
|
810
|
-
description,
|
|
811
|
-
tags,
|
|
812
|
-
mediaUrl
|
|
813
|
-
}, withOpts())
|
|
828
|
+
sticker
|
|
814
829
|
});
|
|
815
830
|
}
|
|
816
831
|
case "roleAdd":
|
|
@@ -835,9 +850,10 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
835
850
|
if (!isActionEnabled("channelInfo")) throw new Error("Discord channel info is disabled.");
|
|
836
851
|
const channelId = readStringParam(params, "channelId", { required: true });
|
|
837
852
|
await readTargetGate.assertReadTargetAllowed({ channelId });
|
|
853
|
+
const channel = await discordGuildActionRuntime.fetchChannelInfoDiscord(channelId, withOpts());
|
|
838
854
|
return jsonResult({
|
|
839
855
|
ok: true,
|
|
840
|
-
channel
|
|
856
|
+
channel
|
|
841
857
|
});
|
|
842
858
|
}
|
|
843
859
|
case "channelList": {
|
|
@@ -845,12 +861,13 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
845
861
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
846
862
|
await assertGuildMetadataReadAllowed(guildId, { filteredResults: true });
|
|
847
863
|
const channels = await discordGuildActionRuntime.listGuildChannelsDiscord(guildId, withOpts());
|
|
864
|
+
const visibleChannels = await readTargetGate.filterGuildChannelList({
|
|
865
|
+
guildId,
|
|
866
|
+
channels
|
|
867
|
+
});
|
|
848
868
|
return jsonResult({
|
|
849
869
|
ok: true,
|
|
850
|
-
channels:
|
|
851
|
-
guildId,
|
|
852
|
-
channels
|
|
853
|
-
})
|
|
870
|
+
channels: visibleChannels
|
|
854
871
|
});
|
|
855
872
|
}
|
|
856
873
|
case "voiceStatus": {
|
|
@@ -858,18 +875,20 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
858
875
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
859
876
|
await assertGuildMetadataReadAllowed(guildId);
|
|
860
877
|
const userId = readStringParam(params, "userId", { required: true });
|
|
878
|
+
const voice = await discordGuildActionRuntime.fetchVoiceStatusDiscord(guildId, userId, withOpts());
|
|
861
879
|
return jsonResult({
|
|
862
880
|
ok: true,
|
|
863
|
-
voice
|
|
881
|
+
voice
|
|
864
882
|
});
|
|
865
883
|
}
|
|
866
884
|
case "eventList": {
|
|
867
885
|
if (!isActionEnabled("events")) throw new Error("Discord events are disabled.");
|
|
868
886
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
869
887
|
await assertGuildMetadataReadAllowed(guildId);
|
|
888
|
+
const events = await discordGuildActionRuntime.listScheduledEventsDiscord(guildId, withOpts());
|
|
870
889
|
return jsonResult({
|
|
871
890
|
ok: true,
|
|
872
|
-
events
|
|
891
|
+
events
|
|
873
892
|
});
|
|
874
893
|
}
|
|
875
894
|
case "eventCreate": {
|
|
@@ -896,27 +915,33 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
896
915
|
image,
|
|
897
916
|
privacy_level: 2
|
|
898
917
|
};
|
|
918
|
+
const event = await discordGuildActionRuntime.createScheduledEventDiscord(guildId, payload, withOpts());
|
|
899
919
|
return jsonResult({
|
|
900
920
|
ok: true,
|
|
901
|
-
event
|
|
921
|
+
event
|
|
902
922
|
});
|
|
903
923
|
}
|
|
904
|
-
case "channelCreate":
|
|
924
|
+
case "channelCreate": {
|
|
905
925
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
926
|
+
const channel = await discordGuildActionRuntime.createChannelDiscord(readDiscordChannelCreateParams(params), withOpts());
|
|
906
927
|
return jsonResult({
|
|
907
928
|
ok: true,
|
|
908
|
-
channel
|
|
929
|
+
channel
|
|
909
930
|
});
|
|
910
|
-
|
|
931
|
+
}
|
|
932
|
+
case "channelEdit": {
|
|
911
933
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
934
|
+
const channel = await discordGuildActionRuntime.editChannelDiscord(readDiscordChannelEditParams(params), withOpts());
|
|
912
935
|
return jsonResult({
|
|
913
936
|
ok: true,
|
|
914
|
-
channel
|
|
937
|
+
channel
|
|
915
938
|
});
|
|
939
|
+
}
|
|
916
940
|
case "channelDelete": {
|
|
917
941
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
918
942
|
const channelId = readStringParam(params, "channelId", { required: true });
|
|
919
|
-
|
|
943
|
+
const result = await discordGuildActionRuntime.deleteChannelDiscord(channelId, withOpts());
|
|
944
|
+
return jsonResult(result);
|
|
920
945
|
}
|
|
921
946
|
case "channelMove":
|
|
922
947
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
@@ -927,14 +952,15 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
927
952
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
928
953
|
const name = readStringParam(params, "name", { required: true });
|
|
929
954
|
const position = readNonNegativeIntegerParam(params, "position");
|
|
955
|
+
const channel = await discordGuildActionRuntime.createChannelDiscord({
|
|
956
|
+
guildId,
|
|
957
|
+
name,
|
|
958
|
+
type: 4,
|
|
959
|
+
position: position ?? void 0
|
|
960
|
+
}, withOpts());
|
|
930
961
|
return jsonResult({
|
|
931
962
|
ok: true,
|
|
932
|
-
category:
|
|
933
|
-
guildId,
|
|
934
|
-
name,
|
|
935
|
-
type: 4,
|
|
936
|
-
position: position ?? void 0
|
|
937
|
-
}, withOpts())
|
|
963
|
+
category: channel
|
|
938
964
|
});
|
|
939
965
|
}
|
|
940
966
|
case "categoryEdit": {
|
|
@@ -942,19 +968,21 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
942
968
|
const categoryId = readStringParam(params, "categoryId", { required: true });
|
|
943
969
|
const name = readStringParam(params, "name");
|
|
944
970
|
const position = readNonNegativeIntegerParam(params, "position");
|
|
971
|
+
const channel = await discordGuildActionRuntime.editChannelDiscord({
|
|
972
|
+
channelId: categoryId,
|
|
973
|
+
name: name ?? void 0,
|
|
974
|
+
position: position ?? void 0
|
|
975
|
+
}, withOpts());
|
|
945
976
|
return jsonResult({
|
|
946
977
|
ok: true,
|
|
947
|
-
category:
|
|
948
|
-
channelId: categoryId,
|
|
949
|
-
name: name ?? void 0,
|
|
950
|
-
position: position ?? void 0
|
|
951
|
-
}, withOpts())
|
|
978
|
+
category: channel
|
|
952
979
|
});
|
|
953
980
|
}
|
|
954
981
|
case "categoryDelete": {
|
|
955
982
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
956
983
|
const categoryId = readStringParam(params, "categoryId", { required: true });
|
|
957
|
-
|
|
984
|
+
const result = await discordGuildActionRuntime.deleteChannelDiscord(categoryId, withOpts());
|
|
985
|
+
return jsonResult(result);
|
|
958
986
|
}
|
|
959
987
|
case "channelPermissionSet": {
|
|
960
988
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
@@ -1010,9 +1038,10 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1010
1038
|
if (!ctx.isActionEnabled("permissions")) throw new Error("Discord permissions are disabled.");
|
|
1011
1039
|
const channelId = ctx.resolveChannelId();
|
|
1012
1040
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1041
|
+
const permissions = await discordMessagingActionRuntime.fetchChannelPermissionsDiscord(channelId, ctx.withOpts());
|
|
1013
1042
|
return jsonResult({
|
|
1014
1043
|
ok: true,
|
|
1015
|
-
permissions
|
|
1044
|
+
permissions
|
|
1016
1045
|
});
|
|
1017
1046
|
}
|
|
1018
1047
|
case "fetchMessage": {
|
|
@@ -1051,10 +1080,11 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1051
1080
|
after: readStringParam(ctx.params, "after"),
|
|
1052
1081
|
around: readStringParam(ctx.params, "around")
|
|
1053
1082
|
};
|
|
1083
|
+
const messages = assertDiscordMessageListResult(await discordMessagingActionRuntime.readMessagesDiscord(channelId, query, ctx.withOpts()));
|
|
1054
1084
|
return jsonResult({
|
|
1055
1085
|
ok: true,
|
|
1056
1086
|
channelId,
|
|
1057
|
-
messages:
|
|
1087
|
+
messages: messages.map((message) => ctx.normalizeMessage(message))
|
|
1058
1088
|
});
|
|
1059
1089
|
}
|
|
1060
1090
|
case "editMessage": {
|
|
@@ -1063,9 +1093,10 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1063
1093
|
const messageId = readStringParam(ctx.params, "messageId", { required: true });
|
|
1064
1094
|
const content = readStringParam(ctx.params, "content", { required: true });
|
|
1065
1095
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1096
|
+
const message = await discordMessagingActionRuntime.editMessageDiscord(channelId, messageId, { content }, ctx.withOpts());
|
|
1066
1097
|
return jsonResult({
|
|
1067
1098
|
ok: true,
|
|
1068
|
-
message
|
|
1099
|
+
message
|
|
1069
1100
|
});
|
|
1070
1101
|
}
|
|
1071
1102
|
case "deleteMessage": {
|
|
@@ -1096,9 +1127,10 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1096
1127
|
if (!ctx.isActionEnabled("pins")) throw new Error("Discord pins are disabled.");
|
|
1097
1128
|
const channelId = ctx.resolveChannelId();
|
|
1098
1129
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1130
|
+
const pins = await discordMessagingActionRuntime.listPinsDiscord(channelId, ctx.withOpts());
|
|
1099
1131
|
return jsonResult({
|
|
1100
1132
|
ok: true,
|
|
1101
|
-
pins:
|
|
1133
|
+
pins: pins.map((pin) => ctx.normalizeMessage(pin))
|
|
1102
1134
|
});
|
|
1103
1135
|
}
|
|
1104
1136
|
case "searchMessages": {
|
|
@@ -1173,9 +1205,10 @@ async function handleDiscordReactionMessagingAction(ctx) {
|
|
|
1173
1205
|
}
|
|
1174
1206
|
if (isEmpty) {
|
|
1175
1207
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1208
|
+
const removed = await discordMessagingActionRuntime.removeOwnReactionsDiscord(channelId, messageId, ctx.withReactionRuntimeOptions());
|
|
1176
1209
|
return jsonResult({
|
|
1177
1210
|
ok: true,
|
|
1178
|
-
removed:
|
|
1211
|
+
removed: removed.removed
|
|
1179
1212
|
});
|
|
1180
1213
|
}
|
|
1181
1214
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
@@ -1191,9 +1224,10 @@ async function handleDiscordReactionMessagingAction(ctx) {
|
|
|
1191
1224
|
const messageId = readStringParam(ctx.params, "messageId", { required: true });
|
|
1192
1225
|
const limit = readPositiveIntegerParam(ctx.params, "limit");
|
|
1193
1226
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1227
|
+
const reactions = await discordMessagingActionRuntime.fetchReactionsDiscord(channelId, messageId, ctx.withReactionRuntimeOptions({ limit }));
|
|
1194
1228
|
return jsonResult({
|
|
1195
1229
|
ok: true,
|
|
1196
|
-
reactions
|
|
1230
|
+
reactions
|
|
1197
1231
|
});
|
|
1198
1232
|
}
|
|
1199
1233
|
default: return;
|
|
@@ -1259,7 +1293,8 @@ async function appendDiscordThreadRenameResult(ctx, params) {
|
|
|
1259
1293
|
};
|
|
1260
1294
|
}
|
|
1261
1295
|
try {
|
|
1262
|
-
|
|
1296
|
+
const channel = await discordMessagingActionRuntime.fetchChannelInfoDiscord(channelId, ctx.withOpts());
|
|
1297
|
+
if (!isDiscordThreadChannelType(channel.type)) return {
|
|
1263
1298
|
...params.payload,
|
|
1264
1299
|
warning: "Discord threadName was ignored because the send target is not a thread."
|
|
1265
1300
|
};
|
|
@@ -1292,8 +1327,14 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1292
1327
|
required: true,
|
|
1293
1328
|
label: "stickerIds"
|
|
1294
1329
|
});
|
|
1295
|
-
await discordMessagingActionRuntime.sendStickerDiscord(to, stickerIds, ctx.withOpts({
|
|
1296
|
-
|
|
1330
|
+
const result = await discordMessagingActionRuntime.sendStickerDiscord(to, stickerIds, ctx.withOpts({
|
|
1331
|
+
content,
|
|
1332
|
+
...ctx.params.silent === true ? { silent: true } : {}
|
|
1333
|
+
}));
|
|
1334
|
+
return jsonResult({
|
|
1335
|
+
ok: true,
|
|
1336
|
+
result
|
|
1337
|
+
});
|
|
1297
1338
|
}
|
|
1298
1339
|
case "sendMessage": {
|
|
1299
1340
|
if (!ctx.isActionEnabled("messages")) throw new Error("Discord message sends are disabled.");
|
|
@@ -1301,7 +1342,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1301
1342
|
const asVoice = ctx.params.asVoice === true;
|
|
1302
1343
|
const silent = ctx.params.silent === true;
|
|
1303
1344
|
const suppressEmbeds = ctx.params.suppressEmbeds === void 0 ? void 0 : ctx.params.suppressEmbeds === true;
|
|
1304
|
-
const rawComponents = ctx.params.components;
|
|
1345
|
+
const rawComponents = coerceDiscordComponentParam(ctx.params.components);
|
|
1305
1346
|
const componentSpec = hasDiscordComponentObjectKeys(rawComponents) ? discordMessagingActionRuntime.readDiscordComponentSpec(rawComponents) : null;
|
|
1306
1347
|
const components = Array.isArray(rawComponents) || typeof rawComponents === "function" ? rawComponents : void 0;
|
|
1307
1348
|
const mediaUrl = readStringParam(ctx.params, "mediaUrl", { trim: false }) ?? readStringParam(ctx.params, "path", { trim: false }) ?? readStringParam(ctx.params, "filePath", { trim: false });
|
|
@@ -1324,25 +1365,26 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1324
1365
|
...componentSpec,
|
|
1325
1366
|
text: normalizedContent
|
|
1326
1367
|
};
|
|
1368
|
+
const result = await discordMessagingActionRuntime.sendDiscordComponentMessage(to, payload, {
|
|
1369
|
+
...ctx.withOpts(),
|
|
1370
|
+
silent,
|
|
1371
|
+
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1372
|
+
sessionKey: sessionKey ?? void 0,
|
|
1373
|
+
agentId: agentId ?? void 0,
|
|
1374
|
+
mediaUrl: mediaUrl ?? void 0,
|
|
1375
|
+
filename: filename ?? void 0,
|
|
1376
|
+
mediaAccess: ctx.options?.mediaAccess,
|
|
1377
|
+
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1378
|
+
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1379
|
+
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1380
|
+
});
|
|
1327
1381
|
return jsonResult(await appendDiscordThreadRenameResult(ctx, {
|
|
1328
1382
|
payload: {
|
|
1329
1383
|
ok: true,
|
|
1330
|
-
result
|
|
1331
|
-
...ctx.withOpts(),
|
|
1332
|
-
silent,
|
|
1333
|
-
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1334
|
-
sessionKey: sessionKey ?? void 0,
|
|
1335
|
-
agentId: agentId ?? void 0,
|
|
1336
|
-
mediaUrl: mediaUrl ?? void 0,
|
|
1337
|
-
filename: filename ?? void 0,
|
|
1338
|
-
mediaAccess: ctx.options?.mediaAccess,
|
|
1339
|
-
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1340
|
-
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1341
|
-
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1342
|
-
}),
|
|
1384
|
+
result,
|
|
1343
1385
|
components: true
|
|
1344
1386
|
},
|
|
1345
|
-
target: to,
|
|
1387
|
+
target: result.receipt?.threadId ?? to,
|
|
1346
1388
|
threadName
|
|
1347
1389
|
}));
|
|
1348
1390
|
}
|
|
@@ -1350,41 +1392,43 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1350
1392
|
if (!mediaUrl) throw new Error("Voice messages require a media file reference (mediaUrl, path, or filePath).");
|
|
1351
1393
|
if (content && content.trim()) throw new Error("Voice messages cannot include text content (Discord limitation). Remove the content parameter.");
|
|
1352
1394
|
assertMediaNotDataUrl(mediaUrl);
|
|
1395
|
+
const result = await discordMessagingActionRuntime.sendVoiceMessageDiscord(to, mediaUrl, {
|
|
1396
|
+
...ctx.withOpts(),
|
|
1397
|
+
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1398
|
+
silent,
|
|
1399
|
+
mediaAccess: ctx.options?.mediaAccess,
|
|
1400
|
+
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1401
|
+
mediaReadFile: ctx.options?.mediaReadFile
|
|
1402
|
+
});
|
|
1353
1403
|
return jsonResult(await appendDiscordThreadRenameResult(ctx, {
|
|
1354
1404
|
payload: {
|
|
1355
1405
|
ok: true,
|
|
1356
|
-
result
|
|
1357
|
-
...ctx.withOpts(),
|
|
1358
|
-
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1359
|
-
silent,
|
|
1360
|
-
mediaAccess: ctx.options?.mediaAccess,
|
|
1361
|
-
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1362
|
-
mediaReadFile: ctx.options?.mediaReadFile
|
|
1363
|
-
}),
|
|
1406
|
+
result,
|
|
1364
1407
|
voiceMessage: true
|
|
1365
1408
|
},
|
|
1366
1409
|
target: to,
|
|
1367
1410
|
threadName
|
|
1368
1411
|
}));
|
|
1369
1412
|
}
|
|
1413
|
+
const result = await discordMessagingActionRuntime.sendMessageDiscord(to, content ?? "", {
|
|
1414
|
+
...ctx.withOpts(),
|
|
1415
|
+
mediaAccess: ctx.options?.mediaAccess,
|
|
1416
|
+
mediaUrl,
|
|
1417
|
+
filename: filename ?? void 0,
|
|
1418
|
+
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1419
|
+
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1420
|
+
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1421
|
+
components,
|
|
1422
|
+
embeds,
|
|
1423
|
+
silent,
|
|
1424
|
+
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1425
|
+
});
|
|
1370
1426
|
return jsonResult(await appendDiscordThreadRenameResult(ctx, {
|
|
1371
1427
|
payload: {
|
|
1372
1428
|
ok: true,
|
|
1373
|
-
result
|
|
1374
|
-
...ctx.withOpts(),
|
|
1375
|
-
mediaAccess: ctx.options?.mediaAccess,
|
|
1376
|
-
mediaUrl,
|
|
1377
|
-
filename: filename ?? void 0,
|
|
1378
|
-
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1379
|
-
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1380
|
-
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1381
|
-
components,
|
|
1382
|
-
embeds,
|
|
1383
|
-
silent,
|
|
1384
|
-
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1385
|
-
})
|
|
1429
|
+
result
|
|
1386
1430
|
},
|
|
1387
|
-
target: to,
|
|
1431
|
+
target: result.receipt?.threadId ?? to,
|
|
1388
1432
|
threadName
|
|
1389
1433
|
}));
|
|
1390
1434
|
}
|
|
@@ -1402,9 +1446,10 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1402
1446
|
appliedTags: readStringArrayParam(ctx.params, "appliedTags") ?? void 0
|
|
1403
1447
|
};
|
|
1404
1448
|
try {
|
|
1449
|
+
const thread = await discordMessagingActionRuntime.createThreadDiscord(channelId, payload, ctx.withOpts());
|
|
1405
1450
|
return jsonResult({
|
|
1406
1451
|
ok: true,
|
|
1407
|
-
thread
|
|
1452
|
+
thread
|
|
1408
1453
|
});
|
|
1409
1454
|
} catch (error) {
|
|
1410
1455
|
if (error instanceof DiscordThreadInitialMessageError) {
|
|
@@ -1436,14 +1481,15 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1436
1481
|
guildId,
|
|
1437
1482
|
channelTargetRequiredMessage: "Discord active thread lists require a wildcard channel allowlist so each read target can be authorized."
|
|
1438
1483
|
});
|
|
1484
|
+
const threads = await discordMessagingActionRuntime.listThreadsDiscord({
|
|
1485
|
+
guildId,
|
|
1486
|
+
channelId,
|
|
1487
|
+
includeArchived,
|
|
1488
|
+
before,
|
|
1489
|
+
limit
|
|
1490
|
+
}, ctx.withOpts());
|
|
1439
1491
|
return jsonResult(normalizeDiscordThreadListActionResult({
|
|
1440
|
-
value:
|
|
1441
|
-
guildId,
|
|
1442
|
-
channelId,
|
|
1443
|
-
includeArchived,
|
|
1444
|
-
before,
|
|
1445
|
-
limit
|
|
1446
|
-
}, ctx.withOpts()),
|
|
1492
|
+
value: threads,
|
|
1447
1493
|
guildId,
|
|
1448
1494
|
channelId,
|
|
1449
1495
|
includeArchived: includeArchived === true,
|
|
@@ -1457,16 +1503,18 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1457
1503
|
const content = readStringParam(ctx.params, "content", { required: true });
|
|
1458
1504
|
const mediaUrl = readStringParam(ctx.params, "mediaUrl");
|
|
1459
1505
|
const replyTo = readStringParam(ctx.params, "replyTo");
|
|
1506
|
+
const result = await discordMessagingActionRuntime.sendMessageDiscord(`channel:${channelId}`, content, {
|
|
1507
|
+
...ctx.withOpts(),
|
|
1508
|
+
mediaUrl,
|
|
1509
|
+
mediaAccess: ctx.options?.mediaAccess,
|
|
1510
|
+
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1511
|
+
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1512
|
+
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1513
|
+
...ctx.params.silent === true ? { silent: true } : {}
|
|
1514
|
+
});
|
|
1460
1515
|
return jsonResult({
|
|
1461
1516
|
ok: true,
|
|
1462
|
-
result
|
|
1463
|
-
...ctx.withOpts(),
|
|
1464
|
-
mediaUrl,
|
|
1465
|
-
mediaAccess: ctx.options?.mediaAccess,
|
|
1466
|
-
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1467
|
-
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1468
|
-
reply: resolveActionReplyReference(ctx, replyTo)
|
|
1469
|
-
})
|
|
1517
|
+
result
|
|
1470
1518
|
});
|
|
1471
1519
|
}
|
|
1472
1520
|
default: return;
|
|
@@ -1543,16 +1591,19 @@ async function handleDiscordModerationAction(action, params, isActionEnabled, cf
|
|
|
1543
1591
|
cfg
|
|
1544
1592
|
});
|
|
1545
1593
|
switch (command.action) {
|
|
1546
|
-
case "timeout":
|
|
1547
|
-
|
|
1548
|
-
member: await discordModerationActionRuntime.timeoutMemberDiscord({
|
|
1594
|
+
case "timeout": {
|
|
1595
|
+
const member = await discordModerationActionRuntime.timeoutMemberDiscord({
|
|
1549
1596
|
guildId: command.guildId,
|
|
1550
1597
|
userId: command.userId,
|
|
1551
1598
|
durationMinutes: command.durationMinutes,
|
|
1552
1599
|
until: command.until,
|
|
1553
1600
|
reason: command.reason
|
|
1554
|
-
}, withOpts())
|
|
1555
|
-
|
|
1601
|
+
}, withOpts());
|
|
1602
|
+
return jsonResult({
|
|
1603
|
+
ok: true,
|
|
1604
|
+
member
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1556
1607
|
case "kick":
|
|
1557
1608
|
await discordModerationActionRuntime.kickMemberDiscord({
|
|
1558
1609
|
guildId: command.guildId,
|
|
@@ -1587,13 +1638,13 @@ const VALID_STATUSES = /* @__PURE__ */ new Set([
|
|
|
1587
1638
|
"idle",
|
|
1588
1639
|
"invisible"
|
|
1589
1640
|
]);
|
|
1590
|
-
async function handleDiscordPresenceAction(action, params, isActionEnabled) {
|
|
1641
|
+
async function handleDiscordPresenceAction(action, params, isActionEnabled, cfg) {
|
|
1591
1642
|
if (action !== "setPresence") throw new Error(`Unknown presence action: ${action}`);
|
|
1592
1643
|
if (!isActionEnabled("presence", false)) throw new Error("Discord presence changes are disabled.");
|
|
1593
|
-
const accountId = readStringParam(params, "accountId");
|
|
1644
|
+
const accountId = readStringParam(params, "accountId") ?? resolveDefaultDiscordAccountId(cfg);
|
|
1594
1645
|
const gateway = getGateway(accountId);
|
|
1595
|
-
if (!gateway) throw new Error(`Discord gateway not available
|
|
1596
|
-
if (!gateway.isConnected) throw new Error(`Discord gateway is not connected
|
|
1646
|
+
if (!gateway) throw new Error(`Discord gateway not available for account "${accountId}". The bot may not be connected.`);
|
|
1647
|
+
if (!gateway.isConnected) throw new Error(`Discord gateway is not connected for account "${accountId}".`);
|
|
1597
1648
|
const statusRaw = readStringParam(params, "status") ?? "online";
|
|
1598
1649
|
if (!VALID_STATUSES.has(statusRaw)) throw new Error(`Invalid status "${statusRaw}". Must be one of: ${[...VALID_STATUSES].join(", ")}`);
|
|
1599
1650
|
const status = statusRaw;
|
|
@@ -1681,17 +1732,17 @@ const moderationActions = /* @__PURE__ */ new Set([
|
|
|
1681
1732
|
"kick",
|
|
1682
1733
|
"ban"
|
|
1683
1734
|
]);
|
|
1684
|
-
const presenceActions = /* @__PURE__ */ new Set(["setPresence"]);
|
|
1685
1735
|
async function handleDiscordAction(params, cfg, options) {
|
|
1686
1736
|
const action = readStringParam(params, "action", { required: true });
|
|
1737
|
+
const accountId = readStringParam(params, "accountId");
|
|
1687
1738
|
const isActionEnabled = createDiscordActionGate({
|
|
1688
1739
|
cfg,
|
|
1689
|
-
accountId
|
|
1740
|
+
accountId
|
|
1690
1741
|
});
|
|
1691
1742
|
if (messagingActions.has(action)) return await handleDiscordMessagingAction(action, params, isActionEnabled, cfg, options);
|
|
1692
1743
|
if (guildActions.has(action)) return await handleDiscordGuildAction(action, params, isActionEnabled, cfg, options);
|
|
1693
1744
|
if (moderationActions.has(action)) return await handleDiscordModerationAction(action, params, isActionEnabled, cfg);
|
|
1694
|
-
if (
|
|
1745
|
+
if (action === "setPresence") return await handleDiscordPresenceAction(action, params, isActionEnabled, cfg);
|
|
1695
1746
|
throw new Error(`Unknown action: ${action}`);
|
|
1696
1747
|
}
|
|
1697
1748
|
//#endregion
|