@openclaw/discord 2026.7.2-beta.4 → 2026.7.2-beta.5
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 +1 -1
- package/dist/{account-inspect-Dztmn4J4.js → account-inspect-SXiCBCgP.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-D2LKPukU.js → accounts-DJTf1LtA.js} +13 -15
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-8TMGXUH4.js → activities-api-CHnz7E7t.js} +5 -5
- package/dist/activities-api.js +1 -1
- package/dist/api.js +16 -16
- package/dist/{approval-handler.runtime-ClZpan85.js → approval-handler.runtime-86UuBchU.js} +5 -5
- package/dist/{approval-message-safety-LyND6GR3.js → approval-message-safety-yjFtfJcK.js} +2 -2
- package/dist/{audit-CFfounXC.js → audit-BF8hmDKp.js} +4 -4
- package/dist/{channel-yq-so4jJ.js → channel-DnOg9aoT.js} +19 -18
- package/dist/{channel-actions-C8n1zWZ-.js → channel-actions-BweII8kV.js} +4 -4
- package/dist/{channel-actions.runtime-CgJy35O0.js → channel-actions.runtime-Dsv063Re.js} +6 -6
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-Tn_O2B7F.js → channel.setup-Cpv7n0I8.js} +23 -50
- package/dist/{chunk-BrZocpfs.js → chunk-CMVEczdm.js} +12 -0
- package/dist/{directory-config-DF85-bUY.js → directory-config-677F_rhf.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CrMtTrb0.js → directory-live-BQk4bBOC.js} +6 -6
- package/dist/{doctor-CORGPgoY.js → doctor-DIcs6IDL.js} +4 -4
- package/dist/{doctor-contract-BPUD3Di9.js → doctor-contract-CCFMIDk9.js} +15 -58
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{handle-action.guild-admin-DikBWer5.js → handle-action.guild-admin-D14y2JtA.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/legacy-state-migrations-api.js +1 -34
- package/dist/{manager.runtime-DVvlH8NR.js → manager.runtime-asX6a4R4.js} +3 -3
- package/dist/{message-handler-1ui-YxsF.js → message-handler-CxjL-a-8.js} +7 -47
- package/dist/message-handler.history-CJOsN9w5.js +28 -0
- package/dist/{message-handler.preflight-CAEQvP3t.js → message-handler.preflight-D-5zBjwh.js} +33 -48
- package/dist/{message-handler.process-REBztvIW.js → message-handler.process-W9QxWA1g.js} +58 -44
- package/dist/{message-utils-ajbkdTVA.js → message-utils-DSxXsDcG.js} +1 -1
- package/dist/model-picker-preference-primitives-D25pnCOu.js +37 -0
- package/dist/{outbound-adapter-XZWo4_HD.js → outbound-adapter-kse7KV--.js} +61 -96
- package/dist/{outbound-components-CTFDDcq5.js → outbound-components-DNgLQwXl.js} +3 -3
- package/dist/{outbound-session-route-D_nc_Ayk.js → outbound-session-route-DJUzy5WA.js} +1 -1
- package/dist/{pluralkit-CCovPs9s.js → pluralkit-DbN-Z7BG.js} +1 -1
- package/dist/{probe-Bci2pS8M.js → probe-BYRdyuw1.js} +43 -53
- package/dist/{probe.runtime-C88gnnXj.js → probe.runtime-uyKOQSBB.js} +1 -1
- package/dist/{provider-CfiChtjf.js → provider-Ca5Gua1B.js} +143 -123
- package/dist/{provider-session.runtime-D9GTBKPg.js → provider-session.runtime-IEheobg4.js} +3 -3
- package/dist/provider.runtime-Bn8horYu.js +2 -0
- package/dist/{resolve-allowlist-common-C1hTvZa4.js → resolve-allowlist-common-BU6_eGKg.js} +1 -1
- package/dist/{resolve-channels-CmFAdMeQ.js → resolve-channels-ByNsOMJj.js} +2 -2
- package/dist/{resolve-users-Cmu75lZy.js → resolve-users-CgWAonw-.js} +2 -2
- package/dist/{runtime-D-6AugWA.js → runtime-BZm4_qXV.js} +9 -9
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/{runtime-api.monitor-DPa2ZoSK.js → runtime-api.monitor-BKYTUIuf.js} +2 -2
- package/dist/runtime-api.monitor.js +4 -4
- package/dist/runtime-api.send.js +6 -6
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{runtime-TwM8IrZU.js → runtime-h03Wce1c.js} +2 -2
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit-njzOejQp.js → security-audit-jGnJF__m.js} +38 -0
- package/dist/{security-audit.runtime-DZbDdAnw.js → security-audit.runtime-CPN0xFYz.js} +1 -1
- package/dist/{send-CfnXLUXq.js → send-C_PfNVFH.js} +5 -5
- package/dist/{send.components-V7cyCKbH.js → send.components-BrfbRJNq.js} +5 -5
- package/dist/{send.outbound-BbC2qjpH.js → send.outbound-1t1CryCK.js} +10 -35
- package/dist/{send.reactions-bLrJCZ4G.js → send.reactions-gesJG-Yp.js} +2 -2
- package/dist/{send.shared-Dfacnk-E.js → send.shared-BRGI9T9F.js} +3 -3
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-DMA7f3a8.js → shared--6-q1Zhl.js} +5 -5
- package/dist/{subagent-hooks-kFyJQ-MK.js → subagent-hooks-Dx9hr5Qy.js} +3 -3
- package/dist/subagent-hooks-api.js +2 -2
- package/dist/{subagent-progress-mjPRFz-a.js → subagent-progress-BZREb7jm.js} +2 -2
- package/dist/{system-events-BSlhBq3u.js → system-events-tVfIe6Xm.js} +1 -1
- package/dist/{target-resolver-Bo1oWLPO.js → target-resolver-_m_TsenB.js} +3 -3
- package/dist/targets-DqNz_mmW.js +3 -0
- package/dist/{thread-bindings-DAHJuT22.js → thread-bindings-u_7pNz5d.js} +4 -4
- package/dist/{thread-bindings.discord-api-C_tCQcv3.js → thread-bindings.discord-api-DOCKdVgx.js} +4 -4
- package/dist/{thread-bindings.manager-DlZEGvC1.js → thread-bindings.manager-BB-OD9-d.js} +5 -4
- package/dist/{transcripts-source-CyJ-sc3n.js → transcripts-source-BW2VfPX0.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-Ci9nhuSi.js → typing-eAhz8LT2.js} +1 -1
- package/package.json +4 -5
- package/dist/provider.runtime-DSzKjpKs.js +0 -2
- package/dist/targets-CB8ahjZk.js +0 -3
- package/npm-shrinkwrap.json +0 -1139
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Official OpenClaw channel plugin for Discord servers, channels, DMs, slash comma
|
|
|
5
5
|
Install from OpenClaw:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw
|
|
8
|
+
openclaw plugins install @openclaw/discord
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Configure a Discord bot token and the channels or servers OpenClaw should handle. The plugin lets OpenClaw agents receive Discord messages and respond through the configured Discord app.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as mergeDiscordAccountConfig, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { a as mergeDiscordAccountConfig, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId } from "./accounts-DJTf1LtA.js";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-SXiCBCgP.js";
|
|
2
2
|
//#region extensions/discord/account-inspect-api.ts
|
|
3
3
|
function inspectDiscordReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectDiscordAccount({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createAccountActionGate, createAccountListHelpers
|
|
1
|
+
import { createAccountActionGate, createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
|
|
2
2
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { mapAllowFromEntries, normalizeChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1, resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
@@ -95,26 +95,24 @@ function resolveDiscordToken(cfg, opts = {}) {
|
|
|
95
95
|
}
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region extensions/discord/src/accounts.ts
|
|
98
|
-
const { listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("discord", {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
const { listAccountIds, resolveDefaultAccountId, resolveAccountConfig: resolveMergedDiscordAccountConfig } = createAccountListHelpers("discord", {
|
|
99
|
+
implicitDefaultAccount: {
|
|
100
|
+
channelKeys: ["token"],
|
|
101
|
+
envVars: ["DISCORD_BOT_TOKEN"]
|
|
102
|
+
},
|
|
103
|
+
nestedObjectKeys: [
|
|
104
|
+
"activities",
|
|
105
|
+
"agentComponents",
|
|
106
|
+
"botLoopProtection"
|
|
107
|
+
]
|
|
108
|
+
});
|
|
102
109
|
const listDiscordAccountIds = listAccountIds;
|
|
103
110
|
const resolveDefaultDiscordAccountId = resolveDefaultAccountId;
|
|
104
111
|
function resolveDiscordAccountConfig(cfg, accountId) {
|
|
105
112
|
return resolveAccountEntry(cfg.channels?.discord?.accounts, accountId);
|
|
106
113
|
}
|
|
107
114
|
function mergeDiscordAccountConfig(cfg, accountId) {
|
|
108
|
-
return
|
|
109
|
-
channelConfig: cfg.channels?.discord,
|
|
110
|
-
accounts: cfg.channels?.discord?.accounts,
|
|
111
|
-
accountId,
|
|
112
|
-
nestedObjectKeys: [
|
|
113
|
-
"activities",
|
|
114
|
-
"agentComponents",
|
|
115
|
-
"botLoopProtection"
|
|
116
|
-
]
|
|
117
|
-
});
|
|
115
|
+
return resolveMergedDiscordAccountConfig(cfg, accountId);
|
|
118
116
|
}
|
|
119
117
|
function resolveDiscordAccountAllowFrom(params) {
|
|
120
118
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-BZm4_qXV.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { u as resolveDiscordChannelId$1 } from "./chunk-
|
|
2
|
-
import { n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import { i as resolveDiscordActivitiesConfig, r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-
|
|
4
|
-
import { S as parseDiscordActivityCustomId, a as buildDiscordPresentationComponents } from "./outbound-session-route-
|
|
5
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
1
|
+
import { u as resolveDiscordChannelId$1 } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
|
|
3
|
+
import { i as resolveDiscordActivitiesConfig, r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-h03Wce1c.js";
|
|
4
|
+
import { S as parseDiscordActivityCustomId, a as buildDiscordPresentationComponents } from "./outbound-session-route-DJUzy5WA.js";
|
|
5
|
+
import { r as sendDiscordComponentMessage } from "./send.components-BrfbRJNq.js";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
package/dist/activities-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as registerDiscordActivities } from "./activities-api-
|
|
1
|
+
import { t as registerDiscordActivities } from "./activities-api-CHnz7E7t.js";
|
|
2
2
|
export { registerDiscordActivities };
|
package/dist/api.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { c as normalizeDiscordOutboundTarget, l as parseDiscordTarget, o as looksLikeDiscordTargetId, s as normalizeDiscordMessagingTarget, u as resolveDiscordChannelId } from "./chunk-
|
|
2
|
-
import { a as mergeDiscordAccountConfig, f as resolveDiscordMaxLinesPerMessage, i as listEnabledDiscordAccounts, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-
|
|
3
|
-
import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as createDiscordFormModal, f as buildDiscordComponentMessage, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, i as buildDiscordInteractiveComponents, m as DISCORD_COMPONENT_ATTACHMENT_PREFIX, p as buildDiscordComponentMessageFlags, r as formatDiscordComponentEventText, u as DiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./outbound-session-route-
|
|
1
|
+
import { c as normalizeDiscordOutboundTarget, l as parseDiscordTarget, o as looksLikeDiscordTargetId, s as normalizeDiscordMessagingTarget, u as resolveDiscordChannelId } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { a as mergeDiscordAccountConfig, f as resolveDiscordMaxLinesPerMessage, i as listEnabledDiscordAccounts, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-DJTf1LtA.js";
|
|
3
|
+
import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as createDiscordFormModal, f as buildDiscordComponentMessage, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, i as buildDiscordInteractiveComponents, m as DISCORD_COMPONENT_ATTACHMENT_PREFIX, p as buildDiscordComponentMessageFlags, r as formatDiscordComponentEventText, u as DiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./outbound-session-route-DJUzy5WA.js";
|
|
4
4
|
import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-C43z8vUm.js";
|
|
5
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
6
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
5
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-_m_TsenB.js";
|
|
6
|
+
import { t as inspectDiscordAccount } from "./account-inspect-SXiCBCgP.js";
|
|
7
7
|
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
8
|
-
import "./targets-
|
|
9
|
-
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./approval-message-safety-
|
|
10
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-
|
|
8
|
+
import "./targets-DqNz_mmW.js";
|
|
9
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./approval-message-safety-yjFtfJcK.js";
|
|
10
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-DnOg9aoT.js";
|
|
11
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
12
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
13
|
-
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-
|
|
14
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
15
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
16
|
-
import { t as fetchPluralKitMessageInfo } from "./pluralkit-
|
|
17
|
-
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
18
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
12
|
+
import { t as discordSetupPlugin } from "./channel.setup-Cpv7n0I8.js";
|
|
13
|
+
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-Dx9hr5Qy.js";
|
|
14
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-D14y2JtA.js";
|
|
15
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-677F_rhf.js";
|
|
16
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-DbN-Z7BG.js";
|
|
17
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-BYRdyuw1.js";
|
|
18
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-jGnJF__m.js";
|
|
19
19
|
import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
20
20
|
//#region extensions/discord/api.ts
|
|
21
|
-
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-
|
|
21
|
+
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-Dsv063Re.js")).handleDiscordMessageAction(...args);
|
|
22
22
|
/**
|
|
23
23
|
* @deprecated Shipped `@openclaw/discord/api` compatibility only. Use native
|
|
24
24
|
* `AbortSignal.any` after filtering optional signals. Removal with the next
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { K as Container, L as serializePayload, Q as Row, W as Button, ct as createUserDmChannel, et as Separator, gt as deleteChannelMessage, nt as TextDisplay, pt as createChannelMessage, vt as editChannelMessage } from "./chunk-
|
|
2
|
-
import { c as buildExecApprovalCustomId } from "./outbound-session-route-
|
|
3
|
-
import { P as createDiscordClient, b as stripUndefinedFields, g as createDiscordMessageNonce } from "./send.shared-
|
|
4
|
-
import { n as formatDiscordApprovalDisplayValue, s as isDiscordExecApprovalClientEnabled, t as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./approval-message-safety-
|
|
5
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
1
|
+
import { K as Container, L as serializePayload, Q as Row, W as Button, ct as createUserDmChannel, et as Separator, gt as deleteChannelMessage, nt as TextDisplay, pt as createChannelMessage, vt as editChannelMessage } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { c as buildExecApprovalCustomId } from "./outbound-session-route-DJUzy5WA.js";
|
|
3
|
+
import { P as createDiscordClient, b as stripUndefinedFields, g as createDiscordMessageNonce } from "./send.shared-BRGI9T9F.js";
|
|
4
|
+
import { n as formatDiscordApprovalDisplayValue, s as isDiscordExecApprovalClientEnabled, t as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./approval-message-safety-yjFtfJcK.js";
|
|
5
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-DnOg9aoT.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as parseDiscordTarget } from "./chunk-
|
|
2
|
-
import { s as resolveDiscordAccount } from "./accounts-
|
|
1
|
+
import { l as parseDiscordTarget } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
|
|
3
3
|
import { normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
5
5
|
import { getExecApprovalReplyMetadata, isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Yt as __exportAll } from "./chunk-
|
|
2
|
-
import { O as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
3
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
4
|
-
import "./send-
|
|
1
|
+
import { Yt as __exportAll } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { O as fetchChannelPermissionsDiscord } from "./send.shared-BRGI9T9F.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-SXiCBCgP.js";
|
|
4
|
+
import "./send-C_PfNVFH.js";
|
|
5
5
|
import { n as collectDiscordAuditChannelIdsForAccount, t as auditDiscordChannelPermissionsWithFetcher } from "./audit-core-xwjIczO0.js";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { l as parseDiscordTarget, o as looksLikeDiscordTargetId, s as normalizeDiscordMessagingTarget } from "./chunk-
|
|
2
|
-
import { c as resolveDiscordAccountAllowFrom, i as listEnabledDiscordAccounts, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import { t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-
|
|
1
|
+
import { l as parseDiscordTarget, o as looksLikeDiscordTargetId, s as normalizeDiscordMessagingTarget } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { c as resolveDiscordAccountAllowFrom, i as listEnabledDiscordAccounts, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
|
|
3
|
+
import { t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-DJUzy5WA.js";
|
|
4
4
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
5
5
|
import { a as projectCredentialSnapshotFields, n as PAIRING_APPROVED_MESSAGE, o as resolveConfiguredFromCredentialStatuses, r as buildTokenChannelStatusSummary, t as DEFAULT_ACCOUNT_ID } from "./channel-api-CAJ0wMoV.js";
|
|
6
6
|
import { u as withAbortTimeout } from "./timeouts-B9cy6RvQ.js";
|
|
7
|
-
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, d as createChannelNativeOriginTargetResolver, f as isChannelExecApprovalClientEnabledFromConfig, i as resolveDiscordCurrentConversationIdentity, l as createApproverRestrictedNativeApprovalCapability, o as isDiscordExecApprovalApprover, p as matchesApprovalRequestFilters, s as isDiscordExecApprovalClientEnabled, u as createChannelApproverDmTargetResolver } from "./approval-message-safety-
|
|
7
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, d as createChannelNativeOriginTargetResolver, f as isChannelExecApprovalClientEnabledFromConfig, i as resolveDiscordCurrentConversationIdentity, l as createApproverRestrictedNativeApprovalCapability, o as isDiscordExecApprovalApprover, p as matchesApprovalRequestFilters, s as isDiscordExecApprovalClientEnabled, u as createChannelApproverDmTargetResolver } from "./approval-message-safety-yjFtfJcK.js";
|
|
8
8
|
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-xwjIczO0.js";
|
|
9
|
-
import { t as discordMessageActions$1 } from "./channel-actions-
|
|
9
|
+
import { t as discordMessageActions$1 } from "./channel-actions-BweII8kV.js";
|
|
10
10
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.js";
|
|
11
11
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DAIlp7Px.js";
|
|
12
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
13
|
-
import { a as discordSetupContract, i as discordSetupAdapter, n as discordConfigAdapter, o as discordSecurityAdapter, t as createDiscordPluginBase } from "./shared-
|
|
12
|
+
import { n as discordOutbound } from "./outbound-adapter-kse7KV--.js";
|
|
13
|
+
import { a as discordSetupContract, i as discordSetupAdapter, n as discordConfigAdapter, o as discordSecurityAdapter, t as createDiscordPluginBase } from "./shared--6-q1Zhl.js";
|
|
14
14
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
15
15
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.js";
|
|
16
16
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -195,7 +195,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
195
195
|
request,
|
|
196
196
|
configOverride
|
|
197
197
|
}),
|
|
198
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
198
|
+
load: async () => (await import("./approval-handler.runtime-86UuBchU.js")).discordApprovalNativeRuntime
|
|
199
199
|
})
|
|
200
200
|
});
|
|
201
201
|
}
|
|
@@ -302,22 +302,22 @@ function resolveDiscordInboundConversation(params) {
|
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region extensions/discord/src/channel.loaders.ts
|
|
305
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
306
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
307
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
308
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
309
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
310
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
311
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
305
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-677F_rhf.js").then((n) => n.t));
|
|
306
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-ByNsOMJj.js").then((n) => n.n));
|
|
307
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-CgWAonw-.js").then((n) => n.n));
|
|
308
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-BB-OD9-d.js").then((n) => n.a));
|
|
309
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-_m_TsenB.js").then((n) => n.r));
|
|
310
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-Bn8horYu.js"));
|
|
311
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-uyKOQSBB.js"));
|
|
312
312
|
async function probeDiscordStatusAccount(params) {
|
|
313
313
|
const startedAtMs = Date.now();
|
|
314
314
|
const runtime = await loadDiscordProbeRuntime();
|
|
315
315
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
316
316
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
317
317
|
}
|
|
318
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
319
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
320
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
318
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-BF8hmDKp.js").then((n) => n.n));
|
|
319
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-C_PfNVFH.js").then((n) => n.t));
|
|
320
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-BQk4bBOC.js").then((n) => n.t));
|
|
321
321
|
//#endregion
|
|
322
322
|
//#region extensions/discord/src/group-policy.ts
|
|
323
323
|
function normalizeDiscordSlug(value) {
|
|
@@ -383,6 +383,7 @@ function resolveDiscordGroupRequireMention(params) {
|
|
|
383
383
|
function resolveDiscordGroupToolPolicy(params) {
|
|
384
384
|
return resolveScopeToolsPolicy({
|
|
385
385
|
...resolveDiscordPolicyScope(params),
|
|
386
|
+
senderPolicyMode: params.senderPolicyMode,
|
|
386
387
|
senderId: params.senderId,
|
|
387
388
|
senderName: params.senderName,
|
|
388
389
|
senderUsername: params.senderUsername,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { h as readDiscordComponentSpec } from "./outbound-session-route-
|
|
3
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
1
|
+
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-DJTf1LtA.js";
|
|
2
|
+
import { h as readDiscordComponentSpec } from "./outbound-session-route-DJUzy5WA.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-SXiCBCgP.js";
|
|
4
4
|
import { i as withDiscordInboundEventDeliveryMetadata } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -41,7 +41,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
41
41
|
function resolveDiscordActionExecutionMode({ action }) {
|
|
42
42
|
return localExecutionActions.has(action) ? "local" : "gateway";
|
|
43
43
|
}
|
|
44
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-
|
|
44
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-Dsv063Re.js"));
|
|
45
45
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
46
46
|
return listDiscordAccountIds(cfg).map((accountId) => inspectDiscordAccount({
|
|
47
47
|
cfg,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { u as resolveDiscordChannelId } from "./chunk-
|
|
2
|
-
import { a as buildDiscordPresentationComponents, i as buildDiscordInteractiveComponents } from "./outbound-session-route-
|
|
3
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { u as resolveDiscordChannelId } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { a as buildDiscordPresentationComponents, i as buildDiscordInteractiveComponents } from "./outbound-session-route-DJUzy5WA.js";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BZm4_qXV.js";
|
|
4
|
+
import "./targets-DqNz_mmW.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
6
|
import { r as notifyDiscordInboundEventOutboundSuccess } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
7
|
-
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-DNgLQwXl.js";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-D14y2JtA.js";
|
|
9
9
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
11
11
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-DnOg9aoT.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { n as inspectDiscordConfiguredToken } from "./account-inspect-
|
|
3
|
-
import { a as discordSetupContract, i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-
|
|
4
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-DJTf1LtA.js";
|
|
2
|
+
import { n as inspectDiscordConfiguredToken } from "./account-inspect-SXiCBCgP.js";
|
|
3
|
+
import { a as discordSetupContract, i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared--6-q1Zhl.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-ByNsOMJj.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-CgWAonw-.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
-
import {
|
|
8
|
+
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
9
|
+
import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptResolvedAllowFrom, resolveEntriesWithOptionalToken, resolveSetupAccountId, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup-runtime";
|
|
9
10
|
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
11
|
+
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
10
12
|
//#region extensions/discord/src/setup-account-state.ts
|
|
11
13
|
function resolveDefaultDiscordSetupAccountId(cfg) {
|
|
12
14
|
return resolveDefaultDiscordAccountId(cfg);
|
|
@@ -128,43 +130,23 @@ function parseDiscordAllowFromId(value) {
|
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
132
|
function createDiscordSetupWizardBase(handlers) {
|
|
131
|
-
const discordDmPolicy = {
|
|
133
|
+
const discordDmPolicy = createChannelDmPolicy({
|
|
132
134
|
label: "Discord",
|
|
133
135
|
channel: channel$1,
|
|
134
|
-
|
|
135
|
-
allowFromKey: "channels.discord.allowFrom",
|
|
136
|
-
resolveConfigKeys: (_cfg, accountId) => accountId && accountId !== DEFAULT_ACCOUNT_ID ? {
|
|
137
|
-
policyKey: `channels.discord.accounts.${accountId}.dmPolicy`,
|
|
138
|
-
allowFromKey: `channels.discord.accounts.${accountId}.allowFrom`
|
|
139
|
-
} : {
|
|
140
|
-
policyKey: "channels.discord.dmPolicy",
|
|
141
|
-
allowFromKey: "channels.discord.allowFrom"
|
|
142
|
-
},
|
|
143
|
-
getCurrent: (cfg, accountId) => resolveDiscordSetupAccountConfig({
|
|
136
|
+
resolveAccount: (cfg, accountId) => resolveDiscordSetupAccountConfig({
|
|
144
137
|
cfg,
|
|
145
138
|
accountId
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
accountId: resolved.accountId,
|
|
156
|
-
patch: {
|
|
157
|
-
dmPolicy: policy,
|
|
158
|
-
...policy === "open" ? { allowFrom: mergeAllowFromEntries(resolved.config.allowFrom ?? [], ["*"]) } : {},
|
|
159
|
-
dm: {
|
|
160
|
-
...resolved.config.dm,
|
|
161
|
-
enabled: typeof resolved.config.dm?.enabled === "boolean" ? resolved.config.dm.enabled : true
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
},
|
|
139
|
+
}),
|
|
140
|
+
buildPatch: ({ account, policy, allowFrom }) => ({
|
|
141
|
+
dmPolicy: policy,
|
|
142
|
+
...allowFrom === void 0 ? {} : { allowFrom },
|
|
143
|
+
dm: {
|
|
144
|
+
...account.config.dm,
|
|
145
|
+
enabled: typeof account.config.dm?.enabled === "boolean" ? account.config.dm.enabled : true
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
166
148
|
promptAllowFrom: handlers.promptAllowFrom
|
|
167
|
-
};
|
|
149
|
+
});
|
|
168
150
|
return {
|
|
169
151
|
channel: channel$1,
|
|
170
152
|
status: createStandardChannelSetupStatus({
|
|
@@ -257,22 +239,13 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
257
239
|
const t = createSetupTranslator();
|
|
258
240
|
const channel = "discord";
|
|
259
241
|
async function resolveDiscordAllowFromEntries(params) {
|
|
260
|
-
return await
|
|
242
|
+
return await resolveBasicAllowFromEntries({
|
|
261
243
|
token: params.token,
|
|
262
244
|
entries: params.entries,
|
|
263
|
-
|
|
264
|
-
input,
|
|
265
|
-
resolved: false,
|
|
266
|
-
id: null
|
|
267
|
-
}),
|
|
268
|
-
resolveEntries: async ({ token, entries }) => (await resolveDiscordUserAllowlist({
|
|
245
|
+
resolveEntries: async ({ token, entries }) => await resolveDiscordUserAllowlist({
|
|
269
246
|
token,
|
|
270
247
|
entries
|
|
271
|
-
})
|
|
272
|
-
input: entry.input,
|
|
273
|
-
resolved: entry.resolved,
|
|
274
|
-
id: entry.id ?? null
|
|
275
|
-
}))
|
|
248
|
+
})
|
|
276
249
|
});
|
|
277
250
|
}
|
|
278
251
|
async function promptDiscordAllowFrom(params) {
|
|
@@ -131,6 +131,9 @@ async function createInteractionCallback(rest, interactionId, token, body) {
|
|
|
131
131
|
async function editWebhookMessage(rest, applicationId, token, messageId, data, query) {
|
|
132
132
|
return query ? await rest.patch(Routes.webhookMessage(applicationId, token, messageId), data, query) : await rest.patch(Routes.webhookMessage(applicationId, token, messageId), data);
|
|
133
133
|
}
|
|
134
|
+
async function deleteWebhookMessage(rest, applicationId, token, messageId) {
|
|
135
|
+
return await rest.delete(Routes.webhookMessage(applicationId, token, messageId));
|
|
136
|
+
}
|
|
134
137
|
async function getWebhookMessage(rest, applicationId, token, messageId) {
|
|
135
138
|
return await rest.get(Routes.webhookMessage(applicationId, token, messageId));
|
|
136
139
|
}
|
|
@@ -1541,6 +1544,9 @@ var InteractionResponseController = class {
|
|
|
1541
1544
|
recordReplyEdit() {
|
|
1542
1545
|
this.state = "replied";
|
|
1543
1546
|
}
|
|
1547
|
+
recordReplyDelete() {
|
|
1548
|
+
this.state = "replied";
|
|
1549
|
+
}
|
|
1544
1550
|
};
|
|
1545
1551
|
function needsComponentsV2Query(body) {
|
|
1546
1552
|
return body !== null && typeof body === "object" && "flags" in body && typeof body.flags === "number" && (body.flags & MessageFlags.IsComponentsV2) !== 0;
|
|
@@ -1696,6 +1702,11 @@ var BaseInteraction = class {
|
|
|
1696
1702
|
this.response.recordReplyEdit();
|
|
1697
1703
|
return result;
|
|
1698
1704
|
}
|
|
1705
|
+
async deleteReply() {
|
|
1706
|
+
const result = await deleteWebhookMessage(this.client.rest, this.client.options.clientId, this.token, "@original");
|
|
1707
|
+
this.response.recordReplyDelete();
|
|
1708
|
+
return result;
|
|
1709
|
+
}
|
|
1699
1710
|
async fetchReply() {
|
|
1700
1711
|
return await getWebhookMessage(this.client.rest, this.client.options.clientId, this.token, "@original");
|
|
1701
1712
|
}
|
|
@@ -2814,6 +2825,7 @@ var discord_exports = /* @__PURE__ */ __exportAll({
|
|
|
2814
2825
|
deleteChannelMessage: () => deleteChannelMessage,
|
|
2815
2826
|
deleteChannelPermission: () => deleteChannelPermission,
|
|
2816
2827
|
deleteOwnMessageReaction: () => deleteOwnMessageReaction,
|
|
2828
|
+
deleteWebhookMessage: () => deleteWebhookMessage,
|
|
2817
2829
|
editApplicationCommand: () => editApplicationCommand,
|
|
2818
2830
|
editChannel: () => editChannel,
|
|
2819
2831
|
editChannelMessage: () => editChannelMessage,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Yt as __exportAll } from "./chunk-
|
|
2
|
-
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { Yt as __exportAll } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-DJTf1LtA.js";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
5
5
|
//#region extensions/discord/src/directory-config.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-677F_rhf.js";
|
|
2
2
|
//#region extensions/discord/directory-contract-api.ts
|
|
3
3
|
const discordDirectoryContractPlugin = {
|
|
4
4
|
id: "discord",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Yt as __exportAll } from "./chunk-
|
|
2
|
-
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-
|
|
1
|
+
import { Yt as __exportAll } from "./chunk-CMVEczdm.js";
|
|
2
|
+
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
|
|
3
3
|
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-C43z8vUm.js";
|
|
4
4
|
import { a as normalizeDiscordSlug } from "./allow-list-DzKrtfah.js";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
@@ -18,7 +18,7 @@ function normalizeSnowflake(value) {
|
|
|
18
18
|
if (!/^\d+$/.test(text)) return null;
|
|
19
19
|
return text;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function normalizeDiscordHandleKey(raw) {
|
|
22
22
|
let handle = normalizeOptionalString(raw) ?? "";
|
|
23
23
|
if (!handle) return null;
|
|
24
24
|
if (handle.startsWith("@")) handle = normalizeOptionalString(handle.slice(1)) ?? "";
|
|
@@ -46,7 +46,7 @@ function rememberDiscordDirectoryUser(params) {
|
|
|
46
46
|
const cache = ensureAccountCache(params.accountId);
|
|
47
47
|
for (const candidate of params.handles) {
|
|
48
48
|
if (typeof candidate !== "string") continue;
|
|
49
|
-
const handle =
|
|
49
|
+
const handle = normalizeDiscordHandleKey(candidate);
|
|
50
50
|
if (!handle) continue;
|
|
51
51
|
setCacheEntry(cache, handle, userId);
|
|
52
52
|
const withoutDiscriminator = handle.replace(DISCORD_DISCRIMINATOR_SUFFIX, "");
|
|
@@ -56,7 +56,7 @@ function rememberDiscordDirectoryUser(params) {
|
|
|
56
56
|
function resolveDiscordDirectoryUserId(params) {
|
|
57
57
|
const cache = discordDirectoryCacheState.handlesByAccount.get(normalizeAccountCacheKey(params.accountId));
|
|
58
58
|
if (!cache) return;
|
|
59
|
-
const handle =
|
|
59
|
+
const handle = normalizeDiscordHandleKey(params.handle);
|
|
60
60
|
if (!handle) return;
|
|
61
61
|
const direct = cache.get(handle);
|
|
62
62
|
if (direct) return direct;
|
|
@@ -158,4 +158,4 @@ async function listDiscordDirectoryPeersLive(params) {
|
|
|
158
158
|
return rows;
|
|
159
159
|
}
|
|
160
160
|
//#endregion
|
|
161
|
-
export {
|
|
161
|
+
export { rememberDiscordDirectoryUser as a, normalizeDiscordHandleKey as i, listDiscordDirectoryGroupsLive as n, resolveDiscordDirectoryUserId as o, listDiscordDirectoryPeersLive as r, directory_live_exports as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
4
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
1
|
+
import { o as resolveDefaultDiscordAccountId } from "./accounts-DJTf1LtA.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-SXiCBCgP.js";
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared--6-q1Zhl.js";
|
|
4
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-CCFMIDk9.js";
|
|
5
5
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|