@openclaw/discord 2026.11.7 → 2026.11.10-beta.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/README.md +37 -0
- package/dist/.setup/{account-inspect-DGkdWwix.mjs → account-inspect-CSz5Qodj.mjs} +2 -3
- package/dist/.setup/{accounts-C_25wyxC.mjs → accounts-DtjvhJUj.mjs} +4 -8
- package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-C3j0qLDp.mjs → allow-list-CkqpzPvP.mjs} +4 -8
- package/dist/.setup/{api-DYRggUgK.mjs → api-C4j_kC-2.mjs} +4 -6
- package/dist/.setup/{approval-handler.runtime-BN4W1r0o.mjs → approval-handler.runtime-DXzPFNvC.mjs} +10 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-BL6EoUun.mjs → audit-B9vk3V2z.mjs} +6 -7
- package/dist/.setup/{channel-DdI2l55_.mjs → channel-CKffiPiV.mjs} +38 -41
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel.setup-kNWMxlgu.mjs → channel.setup-DmGdG9BH.mjs} +7 -10
- package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
- package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
- package/dist/.setup/{components-C1Phe3uw.mjs → components-GePlato3.mjs} +10 -16
- package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
- package/dist/.setup/config-DDwcUaxT.mjs +20 -0
- package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-D3M1livr.mjs} +5 -7
- package/dist/.setup/{conversation-binding-route-K_jFbvi5.mjs → conversation-binding-route-CAaWWJdQ.mjs} +2 -3
- package/dist/.setup/conversation-fork-B6PiUuln.mjs +197 -0
- package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
- package/dist/.setup/{directory-live-CY2-qrHI.mjs → directory-live-B9UoQG9g.mjs} +9 -64
- package/dist/.setup/{discord-BRVFhk09.mjs → discord-cXPUdHQi.mjs} +98 -77
- package/dist/.setup/{doctor-RqH-6JB0.mjs → doctor-MTAWTgRa.mjs} +7 -8
- package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
- package/dist/.setup/{endpoint-runtime-lf4DeLas.mjs → endpoint-runtime-BM3x-m6O.mjs} +1 -2
- package/dist/.setup/{guilds-BSnrns-F.mjs → guilds-DYBhgnfq.mjs} +3 -4
- package/dist/.setup/{handle-action-uD87h2FK.mjs → handle-action-El1ok7Ak.mjs} +13 -12
- package/dist/.setup/{handle-action.guild-admin-CqBx_3mG.mjs → handle-action.guild-admin-CxYfg02j.mjs} +7 -5
- package/dist/.setup/identity-link-B7KOBo_l.mjs +74 -0
- package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-DIyynRvV.mjs} +2 -3
- package/dist/.setup/{live-policy-config-y0Qy36X3.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
- package/dist/.setup/{message-handler-CWL_u0X8.mjs → message-handler-DP3cAQCZ.mjs} +18 -17
- package/dist/.setup/{message-handler.preflight-83tpEdBG.mjs → message-handler.preflight-S5yc9UdR.mjs} +20 -27
- package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-BFntgVKc.mjs} +10 -14
- package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-bXE_4sq5.mjs} +56 -67
- package/dist/.setup/oauth-http-DdVyzSbo.mjs +40 -0
- package/dist/.setup/{outbound-payload-CK3_bDvK.mjs → outbound-payload-Dh6xCO6z.mjs} +18 -13
- package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-G_fK5RAh.mjs} +22 -34
- package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
- package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
- package/dist/.setup/{preflight-audio-C6QtD6HX.mjs → preflight-audio-r4BbaJxh.mjs} +1 -2
- package/dist/.setup/{presence-cache-Dq-3nH7R.mjs → presence-cache-B3xj3b0l.mjs} +1 -2
- package/dist/.setup/{probe-CbDJojNV.mjs → probe-CfGMZwFD.mjs} +5 -6
- package/dist/.setup/{provider-CRb3Myky.mjs → provider-BA4ysXXm.mjs} +200 -249
- package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-Cr2oPicL.mjs} +3 -3
- package/dist/.setup/provider.runtime-D4BlQKDq.mjs +1 -0
- package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
- package/dist/.setup/{realtime-session.runtime-BRYpjS9P.mjs → realtime-session.runtime-DQvAKxj9.mjs} +15 -25
- package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-B-S0wRIw.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
- package/dist/.setup/{resolve-channels-g16NM6Ho.mjs → resolve-channels-BNnyfCR8.mjs} +6 -7
- package/dist/.setup/{resolve-users-DAfOOXdy.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime--HZ9r3tF.mjs → runtime-CkeNX7ic.mjs} +59 -50
- package/dist/.setup/{runtime-BMgTyuwg.mjs → runtime-DSaHEGJd.mjs} +4 -24
- package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
- package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs} +1 -2
- package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
- package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
- package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
- package/dist/.setup/{send-CtvwfZQ2.mjs → send-DKzwsZkm.mjs} +26 -31
- package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-CIZALYDP.mjs} +12 -14
- package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-cQ4Ohmsc.mjs} +11 -16
- package/dist/.setup/send.permissions-BvH_Dr8p.mjs +369 -0
- package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-CZ7ks6g7.mjs} +64 -17
- package/dist/.setup/send.shared-D2lh737v.mjs +259 -0
- package/dist/.setup/{sender-identity-BbA7FNbr.mjs → sender-identity-Dt5ELjRN.mjs} +2 -3
- package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
- package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-BJt8tAAC.mjs +2 -0
- package/dist/.setup/{shared-Dv2DamaK.mjs → shared-Bf7ifHlc.mjs} +14 -17
- package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
- package/dist/.setup/{subagent-hooks-yT45eTyz.mjs → subagent-hooks-CVmIOrAR.mjs} +4 -5
- package/dist/.setup/{system-events-Dlzp9Jcj.mjs → system-events-DB6p2H4l.mjs} +3 -4
- package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
- package/dist/.setup/{target-resolver-BzaZPBm9.mjs → target-resolver-48znkzky.mjs} +6 -7
- package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
- package/dist/.setup/{thread-bindings-DRWhgKCc.mjs → thread-bindings-DTHVdmvF.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-CWJKirn1.mjs → thread-bindings.manager-6EnH3YZh.mjs} +45 -30
- package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-BPO6pPzd.mjs} +9 -12
- package/dist/.setup/{threading-BbsPuT5G.mjs → threading-PC3IIaHd.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-C3F_ErM1.mjs} +20 -33
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-oJ6BZs5D.mjs → voice-runtime-CZGbraKC.mjs} +28 -46
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +10 -50
- package/dist/api.js +21 -22
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +2 -3
- package/dist/doctor-contract-api.js +7 -8
- package/dist/index.js +1 -2
- package/dist/runtime-api.js +23 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +2 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -26
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +7 -2
- package/package.json +5 -5
- package/dist/.setup/provider.runtime-tmkt3QOg.mjs +0 -1
- package/dist/.setup/send.shared-B_KKRrD7.mjs +0 -589
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as isDiscordMutableAllowEntry } from "./security-doctor-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-4s7omTZd.mjs";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk/channel-policy";
|
|
6
6
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
7
7
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|
|
8
|
-
|
|
8
|
+
// extensions/discord/src/security-audit.ts
|
|
9
9
|
var security_audit_exports = /* @__PURE__ */ __exportAll({ collectDiscordSecurityAuditFindings: () => collectDiscordSecurityAuditFindings });
|
|
10
10
|
function isWildcardEntry(value) {
|
|
11
11
|
return String(value).trim() === "*";
|
|
@@ -116,5 +116,4 @@ async function collectDiscordSecurityAuditFindings(params) {
|
|
|
116
116
|
});
|
|
117
117
|
return findings;
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
export { security_audit_exports as n, collectDiscordSecurityAuditFindings as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/security-contract.ts
|
|
3
3
|
const unsupportedSecretRefSurfacePatterns = ["channels.discord.threadBindings.webhookToken", "channels.discord.accounts.*.threadBindings.webhookToken"];
|
|
4
4
|
function collectUnsupportedSecretRefConfigCandidates(raw) {
|
|
5
5
|
if (!isRecord(raw) || !isRecord(raw.channels) || !isRecord(raw.channels.discord)) return [];
|
|
@@ -15,5 +15,4 @@ function collectUnsupportedSecretRefConfigCandidates(raw) {
|
|
|
15
15
|
for (const [accountId, account] of Object.entries(isRecord(discord.accounts) ? discord.accounts : {})) addCandidate(account, `channels.discord.accounts.${accountId}`);
|
|
16
16
|
return candidates;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { unsupportedSecretRefSurfacePatterns as n, collectUnsupportedSecretRefConfigCandidates as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { buildMutableAllowEntryDetector } from "openclaw/plugin-sdk/channel-policy";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/security-doctor.ts
|
|
3
3
|
const isDiscordMutableAllowEntry = buildMutableAllowEntryDetector({ stableIdPattern: /^(?:\d+|<@!?\d+>|(?:discord|user|pk):.+)$/ });
|
|
4
|
-
//#endregion
|
|
5
4
|
export { isDiscordMutableAllowEntry as t };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-
|
|
4
|
-
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
5
|
-
import {
|
|
6
|
-
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-
|
|
7
|
-
import { o as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { a as fetchMemberGuildPermissionsDiscord, c as hasAnyChannelPermissionDiscord, i as fetchChannelPermissionsDiscord, l as hasAnyGuildPermissionDiscord, m as resolveDiscordRest, n as canManageGuildRoleDiscord, p as resolveDiscordClientAccountContext, r as canViewDiscordGuildChannel, s as hasAllGuildPermissionsDiscord, t as canManageGuildMemberRoleDiscord, u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
|
|
3
|
+
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-cXPUdHQi.mjs";
|
|
4
|
+
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-CkqpzPvP.mjs";
|
|
5
|
+
import { S as chunkDiscordTextWithMode, n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, v as classifyDiscordDeliveryFailure, x as recordDiscordMessageCreateAmbiguity, y as createDiscordRetryRunner } from "./send.receipt-CZ7ks6g7.mjs";
|
|
6
|
+
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
7
|
+
import { C as resolveDiscordSuppressEmbeds, a as normalizeEmojiName, b as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, g as DiscordSendError, h as DISCORD_MAX_STICKER_BYTES, m as DISCORD_MAX_EVENT_COVER_BYTES, n as buildDiscordTextChunks, o as normalizeReactionEmoji, p as DISCORD_MAX_EMOJI_BYTES, r as buildReactionIdentifier, t as buildDiscordSendError, y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
|
|
8
|
+
import { o as parseDiscordHttpErrorBody } from "./api-C4j_kC-2.mjs";
|
|
9
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-48znkzky.mjs";
|
|
10
|
+
import { a as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-cQ4Ohmsc.mjs";
|
|
11
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-CT9hnmo4.mjs";
|
|
11
12
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
13
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
13
14
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -26,7 +27,7 @@ import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
|
26
27
|
import fs from "node:fs/promises";
|
|
27
28
|
import path from "node:path";
|
|
28
29
|
import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
|
|
29
|
-
|
|
30
|
+
// extensions/discord/src/send.channels.ts
|
|
30
31
|
async function createChannelDiscord(payload, opts) {
|
|
31
32
|
const rest = resolveDiscordRest(opts);
|
|
32
33
|
const body = stripUndefinedFields({
|
|
@@ -87,8 +88,7 @@ async function removeChannelPermissionDiscord(channelId, targetId, opts) {
|
|
|
87
88
|
await resolveDiscordRest(opts).delete(Routes.channelPermission(channelId, targetId));
|
|
88
89
|
return { ok: true };
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
//#region extensions/discord/src/send.emojis-stickers.ts
|
|
91
|
+
// extensions/discord/src/send.emojis-stickers.ts
|
|
92
92
|
const DISCORD_IMAGE_UPLOAD_TYPES = [
|
|
93
93
|
"image/png",
|
|
94
94
|
"image/jpeg",
|
|
@@ -146,8 +146,7 @@ async function uploadStickerDiscord(payload, opts) {
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
//#region extensions/discord/src/send.guild.ts
|
|
149
|
+
// extensions/discord/src/send.guild.ts
|
|
151
150
|
function readDiscordResource(read) {
|
|
152
151
|
return async (id, opts) => await read(resolveDiscordRest(opts), id);
|
|
153
152
|
}
|
|
@@ -226,8 +225,7 @@ async function banMemberDiscord(payload, opts) {
|
|
|
226
225
|
});
|
|
227
226
|
return { ok: true };
|
|
228
227
|
}
|
|
229
|
-
|
|
230
|
-
//#region extensions/discord/src/send.messages.ts
|
|
228
|
+
// extensions/discord/src/send.messages.ts
|
|
231
229
|
const DISCORD_THREAD_TRANSPORT_ONLY_MAX_LINES = Number.MAX_SAFE_INTEGER;
|
|
232
230
|
function resolveDiscordThreadStarterMessageId(thread) {
|
|
233
231
|
const starterMessage = "message" in thread ? thread.message : void 0;
|
|
@@ -316,17 +314,20 @@ async function deleteMessageDiscord(channelId, messageId, opts) {
|
|
|
316
314
|
}, "message-delete");
|
|
317
315
|
return { ok: true };
|
|
318
316
|
}
|
|
319
|
-
async function listPinsDiscord(channelId, opts) {
|
|
317
|
+
async function listPinsDiscord(channelId, opts, limit) {
|
|
320
318
|
const rest = resolveDiscordRest(opts);
|
|
321
319
|
const messages = [];
|
|
322
320
|
let before;
|
|
323
321
|
while (true) {
|
|
324
322
|
const page = await rest.get(Routes.channelMessagesPins(channelId), {
|
|
325
|
-
limit: 50,
|
|
323
|
+
limit: limit === void 0 ? 50 : Math.min(50, limit - messages.length),
|
|
326
324
|
...before ? { before } : {}
|
|
327
325
|
});
|
|
328
326
|
messages.push(...page.items.map((pin) => pin.message));
|
|
329
|
-
if (!page.has_more
|
|
327
|
+
if (!page.has_more || limit !== void 0 && messages.length >= limit) {
|
|
328
|
+
if (limit !== void 0 && messages.length > limit) messages.length = limit;
|
|
329
|
+
return messages;
|
|
330
|
+
}
|
|
330
331
|
const nextBefore = page.items.at(-1)?.pinned_at;
|
|
331
332
|
if (!nextBefore || nextBefore === before) throw new Error("Discord pin pagination did not advance.");
|
|
332
333
|
before = nextBefore;
|
|
@@ -429,8 +430,7 @@ async function searchMessagesDiscord(query, opts) {
|
|
|
429
430
|
assertDiscordSearchResponse(result);
|
|
430
431
|
return result;
|
|
431
432
|
}
|
|
432
|
-
|
|
433
|
-
//#region extensions/discord/src/send.webhook.ts
|
|
433
|
+
// extensions/discord/src/send.webhook.ts
|
|
434
434
|
const DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
435
435
|
const DISCORD_WEBHOOK_TIMEOUT_MS = DISCORD_REST_TIMEOUT_MS;
|
|
436
436
|
function throwIfWebhookDeadlineExpired(signal) {
|
|
@@ -548,8 +548,7 @@ async function sendWebhookMessageDiscord(text, opts) {
|
|
|
548
548
|
deadline.cleanup();
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
|
|
552
|
-
//#region extensions/discord/src/send.voice.ts
|
|
551
|
+
// extensions/discord/src/send.voice.ts
|
|
553
552
|
const WAVEFORM_SAMPLES = 256;
|
|
554
553
|
const DISCORD_OPUS_SAMPLE_RATE_HZ = 48e3;
|
|
555
554
|
const DISCORD_VOICE_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
@@ -861,8 +860,7 @@ async function sendVoiceMessageDiscord(to, audioPath, opts) {
|
|
|
861
860
|
});
|
|
862
861
|
});
|
|
863
862
|
}
|
|
864
|
-
|
|
865
|
-
//#region extensions/discord/src/send.typing.ts
|
|
863
|
+
// extensions/discord/src/send.typing.ts
|
|
866
864
|
async function sendTypingDiscord(channelId, opts) {
|
|
867
865
|
await resolveDiscordRest(opts).post(Routes.channelTyping(channelId));
|
|
868
866
|
return {
|
|
@@ -870,8 +868,7 @@ async function sendTypingDiscord(channelId, opts) {
|
|
|
870
868
|
channelId
|
|
871
869
|
};
|
|
872
870
|
}
|
|
873
|
-
|
|
874
|
-
//#region extensions/discord/src/send.reactions.ts
|
|
871
|
+
// extensions/discord/src/send.reactions.ts
|
|
875
872
|
function reactionMutation(operation, label) {
|
|
876
873
|
return async (channelId, messageId, emoji, opts) => {
|
|
877
874
|
const { rest, request } = createDiscordClient(opts);
|
|
@@ -927,8 +924,7 @@ async function fetchReactionsDiscord(channelId, messageId, opts) {
|
|
|
927
924
|
}
|
|
928
925
|
return summaries;
|
|
929
926
|
}
|
|
930
|
-
|
|
931
|
-
//#region extensions/discord/src/send.ts
|
|
927
|
+
// extensions/discord/src/send.ts
|
|
932
928
|
var send_exports = /* @__PURE__ */ __exportAll({
|
|
933
929
|
DiscordSendError: () => DiscordSendError,
|
|
934
930
|
DiscordThreadInitialMessageError: () => DiscordThreadInitialMessageError,
|
|
@@ -984,5 +980,4 @@ var send_exports = /* @__PURE__ */ __exportAll({
|
|
|
984
980
|
uploadEmojiDiscord: () => uploadEmojiDiscord,
|
|
985
981
|
uploadStickerDiscord: () => uploadStickerDiscord
|
|
986
982
|
});
|
|
987
|
-
//#endregion
|
|
988
983
|
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,11 +1,12 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { r as createDiscordSendResult } from "./send.receipt-
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
|
|
3
|
+
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-cXPUdHQi.mjs";
|
|
4
|
+
import { r as createDiscordSendResult } from "./send.receipt-CZ7ks6g7.mjs";
|
|
5
|
+
import { _ as SUPPRESS_NOTIFICATIONS_FLAG, c as resolveChannelId, l as resolveDiscordChannel, t as buildDiscordSendError, y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-48znkzky.mjs";
|
|
7
|
+
import { t as sendMessageDiscord } from "./send.outbound-cQ4Ohmsc.mjs";
|
|
8
|
+
import { a as buildDiscordComponentMessage, u as resolveDiscordComponentAttachmentName } from "./components-GePlato3.mjs";
|
|
9
|
+
import { n as getOptionalDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
|
|
9
10
|
import { hasNonEmptyString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
11
|
import { ChannelType } from "discord-api-types/v10";
|
|
11
12
|
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
@@ -16,7 +17,7 @@ import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runt
|
|
|
16
17
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
17
18
|
import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
18
19
|
import { createAsyncLock } from "openclaw/plugin-sdk/async-lock-runtime";
|
|
19
|
-
|
|
20
|
+
// extensions/discord/src/components-registry-state.ts
|
|
20
21
|
const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("openclaw.discord.componentRegistryState"), () => ({
|
|
21
22
|
withRegistryLock: createAsyncLock(),
|
|
22
23
|
componentEntries: /* @__PURE__ */ new Map(),
|
|
@@ -31,8 +32,7 @@ const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("opencla
|
|
|
31
32
|
state.persistentModalStore = void 0;
|
|
32
33
|
state.persistentRegistryDisabled = false;
|
|
33
34
|
}));
|
|
34
|
-
|
|
35
|
-
//#region extensions/discord/src/components-registry.ts
|
|
35
|
+
// extensions/discord/src/components-registry.ts
|
|
36
36
|
const DEFAULT_COMPONENT_TTL_MS = 18e5;
|
|
37
37
|
const PERSISTENT_COMPONENT_NAMESPACE = "discord.components";
|
|
38
38
|
const PERSISTENT_MODAL_NAMESPACE = "discord.modals";
|
|
@@ -227,8 +227,7 @@ async function resolveDiscordModalEntryWithPersistence(params) {
|
|
|
227
227
|
});
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
//#region extensions/discord/src/send.components.ts
|
|
230
|
+
// extensions/discord/src/send.components.ts
|
|
232
231
|
var send_components_exports = /* @__PURE__ */ __exportAll({
|
|
233
232
|
editDiscordComponentMessage: () => editDiscordComponentMessage,
|
|
234
233
|
registerBuiltDiscordComponentMessage: () => registerBuiltDiscordComponentMessage,
|
|
@@ -394,5 +393,4 @@ async function writeDiscordComponentMessage(to, spec, opts, messageId) {
|
|
|
394
393
|
});
|
|
395
394
|
return deliveryResult ?? toDeliveryResult();
|
|
396
395
|
}
|
|
397
|
-
//#endregion
|
|
398
396
|
export { registerDiscordComponentEntries as a, send_components_exports as i, registerBuiltDiscordComponentMessage as n, resolveDiscordComponentEntryWithPersistence as o, sendDiscordComponentMessage as r, resolveDiscordModalEntryWithPersistence as s, editDiscordComponentMessage as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, u as
|
|
5
|
-
import {
|
|
6
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
|
|
3
|
+
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-cXPUdHQi.mjs";
|
|
4
|
+
import { d as normalizeDiscordSnowflake, m as createReusableDiscordReplyReference, n as createDiscordSendReceiptFromResults, p as resolveDiscordDirectoryUserId, r as createDiscordSendResult, u as normalizeDiscordHandleKey } from "./send.receipt-CZ7ks6g7.mjs";
|
|
5
|
+
import { C as resolveDiscordSuppressEmbeds, S as resolveDiscordSendEmbeds, b as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, f as sendDiscordMedia, i as normalizeDiscordPollInput, l as resolveDiscordChannel, n as buildDiscordTextChunks, s as normalizeStickerIds, t as buildDiscordSendError, v as buildDiscordMessageRequest, x as resolveDiscordSendComponents, y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-48znkzky.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { ChannelType } from "discord-api-types/v10";
|
|
9
9
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -14,7 +14,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
14
14
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
15
15
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
16
16
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
17
|
-
|
|
17
|
+
// extensions/discord/src/url-ranges.ts
|
|
18
18
|
const DISCORD_URL_START_RE = /(?:[A-Za-z][A-Za-z0-9+.-]*:\/\/|www\.|\/\/|mailto:)/giu;
|
|
19
19
|
function findDiscordUrlRanges(markdown) {
|
|
20
20
|
const ranges = [];
|
|
@@ -42,8 +42,7 @@ function findDiscordUrlRanges(markdown) {
|
|
|
42
42
|
}
|
|
43
43
|
return ranges;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
//#region extensions/discord/src/mentions.ts
|
|
45
|
+
// extensions/discord/src/mentions.ts
|
|
47
46
|
const MENTION_CANDIDATE_PATTERN = /(^|[\s([{"'.,;:!?])@([a-z0-9_.-]{2,32}(?:#[0-9]{4})?)/gi;
|
|
48
47
|
const DISCORD_RESERVED_MENTIONS = /* @__PURE__ */ new Set(["everyone", "here"]);
|
|
49
48
|
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
@@ -138,8 +137,7 @@ function rewriteDiscordKnownMentions(text, params) {
|
|
|
138
137
|
function discordTextHasBroadcastMention(text) {
|
|
139
138
|
return DISCORD_BROADCAST_MENTION_PATTERN.test(text);
|
|
140
139
|
}
|
|
141
|
-
|
|
142
|
-
//#region extensions/discord/src/markdown.ts
|
|
140
|
+
// extensions/discord/src/markdown.ts
|
|
143
141
|
const DISCORD_NATIVE_TOKEN_RE = /<a?:[A-Za-z0-9_]+:\d+>|<\/[^>]+:\d+>/giu;
|
|
144
142
|
function normalizeDiscordBold(markdown) {
|
|
145
143
|
if (!markdown.includes("__")) return markdown;
|
|
@@ -288,8 +286,7 @@ function normalizeDiscordBold(markdown) {
|
|
|
288
286
|
function renderDiscordMarkdown(markdown, tableMode) {
|
|
289
287
|
return normalizeDiscordBold(convertMarkdownTables(markdown, tableMode));
|
|
290
288
|
}
|
|
291
|
-
|
|
292
|
-
//#region extensions/discord/src/outbound-text.ts
|
|
289
|
+
// extensions/discord/src/outbound-text.ts
|
|
293
290
|
function prepareDiscordOutboundText(text, params) {
|
|
294
291
|
const { account } = params;
|
|
295
292
|
const renderedText = renderDiscordMarkdown(text, params.tableMode ?? resolveMarkdownTableMode({
|
|
@@ -306,8 +303,7 @@ function prepareDiscordOutboundText(text, params) {
|
|
|
306
303
|
})
|
|
307
304
|
};
|
|
308
305
|
}
|
|
309
|
-
|
|
310
|
-
//#region extensions/discord/src/send.outbound.ts
|
|
306
|
+
// extensions/discord/src/send.outbound.ts
|
|
311
307
|
var send_outbound_exports = /* @__PURE__ */ __exportAll({
|
|
312
308
|
sendMessageDiscord: () => sendMessageDiscord,
|
|
313
309
|
sendPollDiscord: () => sendPollDiscord,
|
|
@@ -574,5 +570,4 @@ async function sendDiscordStructuredMessage(to, opts, kind, buildPayload) {
|
|
|
574
570
|
});
|
|
575
571
|
});
|
|
576
572
|
}
|
|
577
|
-
//#endregion
|
|
578
573
|
export { prepareDiscordOutboundText as a, send_outbound_exports as i, sendPollDiscord as n, discordTextHasBroadcastMention as o, sendStickerDiscord as r, formatMention as s, sendMessageDiscord as t };
|