@openclaw/discord 2026.9.6 → 2026.9.8
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/assets/icon.png +0 -0
- package/dist/.setup/{account-inspect-BwQj24ht.mjs → account-inspect-De8hOUxG.mjs} +1 -1
- package/dist/.setup/{accounts-CwJQoLjM.mjs → accounts-ChaMcixG.mjs} +1 -4
- package/dist/.setup/{activities-api-COU4-0nR.mjs → activities-api-tvbsU2e3.mjs} +38 -66
- package/dist/.setup/{api-CBK9zcq5.mjs → api-DVbJwZVt.mjs} +10 -2
- package/dist/.setup/{approval-handler.runtime-CbBktBb4.mjs → approval-handler.runtime-DxCK2Rux.mjs} +49 -125
- package/dist/.setup/{approval-message-updates-jf9zMaIC.mjs → approval-message-updates-BKFqavHZ.mjs} +2 -2
- package/dist/.setup/{audit-vKbh-LFR.mjs → audit-CLg9I71N.mjs} +5 -5
- package/dist/.setup/{channel-Dv4e3Jpc.mjs → channel-DxlUVU9t.mjs} +121 -227
- package/dist/.setup/{channel-type-DKnjV1XW.mjs → channel-type-DRCrEMss.mjs} +22 -22
- package/dist/.setup/{channel.setup-0NX6FFwi.mjs → channel.setup-CRo1GjV7.mjs} +6 -9
- package/dist/.setup/{components-yBEb75bB.mjs → components-Cq1PvIpN.mjs} +41 -69
- package/dist/.setup/{config-schema-CiZz-mtA.mjs → config-schema-oxELUSDx.mjs} +19 -44
- package/dist/.setup/{conversation-binding-route-B7qImK_b.mjs → conversation-binding-route-Caz_XuFH.mjs} +10 -5
- package/dist/.setup/{directory-config-BytTftz-.mjs → directory-config-esqNn0Eo.mjs} +6 -9
- package/dist/.setup/{directory-live--EGTH0DC.mjs → directory-live-DtKRHuGV.mjs} +6 -12
- package/dist/.setup/{discord-BXpHW-cu.mjs → discord-0xJYfdDD.mjs} +82 -386
- package/dist/.setup/{doctor-D1R-uFIu.mjs → doctor-BCl1H5tl.mjs} +21 -36
- package/dist/.setup/{doctor-contract-Co5vRCZ6.mjs → doctor-contract-CvvgwrrG.mjs} +41 -50
- package/dist/.setup/{channel-actions.runtime-leZuw01r.mjs → handle-action-CUvQWnE7.mjs} +67 -104
- package/dist/.setup/{handle-action.guild-admin-DcFa8NwA.mjs → handle-action.guild-admin-Df-8gVle.mjs} +62 -120
- package/dist/.setup/{live-policy-config-eKQ-PLdy.mjs → live-policy-config-8Pv20CHc.mjs} +2 -3
- package/dist/.setup/{message-handler-X6ejmbtY.mjs → message-handler-B-Jk4oDk.mjs} +18 -94
- package/dist/.setup/{message-handler.preflight-pluralkit-8Xji34AF.mjs → message-handler.preflight-pluralkit-CWLUBVcx.mjs} +8 -10
- package/dist/.setup/{message-handler.preflight-DE_POxFc.mjs → message-handler.preflight-v-__NSDq.mjs} +69 -180
- package/dist/.setup/{message-handler.process-CCmIVnxy.mjs → message-handler.process-BNFFuChn.mjs} +65 -86
- package/dist/.setup/{outbound-adapter-ClIgmu4F.mjs → outbound-adapter-BobT-kse.mjs} +105 -19
- package/dist/.setup/{outbound-session-route-VulUE0yV.mjs → outbound-session-route-zVGxxceg.mjs} +140 -108
- package/dist/.setup/{pluralkit-CdAt1G0P.mjs → pluralkit-a6_NLfH9.mjs} +1 -1
- package/dist/.setup/{presence-cache-dYSHPWMx.mjs → presence-cache-Di3H3DIU.mjs} +0 -4
- package/dist/.setup/{probe-CupW4we4.mjs → probe-LYrIHlBF.mjs} +13 -4
- package/dist/.setup/{provider-iOf73HW-.mjs → provider-B_G5hASF.mjs} +721 -1416
- package/dist/.setup/provider-session.runtime-BYlTBFD2.mjs +6 -0
- package/dist/.setup/provider.runtime-CUE3UxER.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-Dz8uVutq.mjs → realtime-session.runtime-oUd9DOcz.mjs} +41 -55
- package/dist/.setup/{receive-recovery-DHst8WRx.mjs → receive-recovery-CHPOsnLc.mjs} +1 -4
- package/dist/.setup/{resolve-allowlist-common-CwMBzbx9.mjs → resolve-allowlist-common-DPdRggu5.mjs} +4 -7
- package/dist/.setup/{resolve-channels-BbvsLQOZ.mjs → resolve-channels-BFPNRmVv.mjs} +21 -40
- package/dist/.setup/{resolve-users-ByFlR7LQ.mjs → resolve-users-0-aBuCy3.mjs} +4 -4
- package/dist/.setup/{retry-BEYkDy0P.mjs → retry-pz_cSha2.mjs} +3 -3
- package/dist/.setup/rolldown-runtime-B4FMCO8f.mjs +28 -0
- package/dist/.setup/{runtime-B8lJfyrA.mjs → runtime-FN000lxA.mjs} +60 -162
- package/dist/.setup/runtime-doctor-migrations-CshUGl36.mjs +159 -0
- package/dist/.setup/{runtime-DisDbixd.mjs → runtime-sUksZ--Q.mjs} +2 -5
- package/dist/.setup/{secret-config-contract-DFu9hfU8.mjs → secret-config-contract-uOE2J7yM.mjs} +15 -85
- package/dist/.setup/{security-audit-s5w50-Ly.mjs → security-audit-Cdaegq7C.mjs} +3 -1
- package/dist/.setup/{send-CIBzvXjS.mjs → send-CrfEI6Bs.mjs} +53 -108
- package/dist/.setup/{send.components-ChY21qr-.mjs → send.components-DxQAMfES.mjs} +62 -107
- package/dist/.setup/{send.outbound-QTyuFupn.mjs → send.outbound-BISKnb-a.mjs} +66 -140
- package/dist/.setup/{send.shared-VNvWfX2T.mjs → send.shared-DGFkbkQR.mjs} +10 -25
- package/dist/.setup/{sender-identity-0Ymgvmaj.mjs → sender-identity-B9X5Vb9R.mjs} +2 -3
- package/dist/.setup/setup-plugin-api-BQUBxbhe.mjs +3 -0
- package/dist/.setup/{shared-DHPDaMSx.mjs → shared-B3wZ4hN-.mjs} +25 -32
- package/dist/.setup/{subagent-hooks-CjW7r8Pe.mjs → subagent-hooks-nlUE9ow7.mjs} +5 -6
- package/dist/.setup/system-events-CdeZnvPV.mjs +33 -0
- package/dist/.setup/{target-resolver-BXpy6VT8.mjs → target-resolver-BuLapkhy.mjs} +9 -12
- package/dist/.setup/targets-0KUcEIYx.mjs +3 -0
- package/dist/.setup/{thread-bindings-CEh2dhqP.mjs → thread-bindings-D7TfgjR_.mjs} +33 -35
- package/dist/.setup/{thread-bindings.manager-ve-i6oqt.mjs → thread-bindings.manager-DN-NissX.mjs} +325 -233
- package/dist/.setup/thread-bindings.session-updates-CshfKghV.mjs +359 -0
- package/dist/.setup/{thread-bindings.state-BThFQEga.mjs → thread-bindings.state-g6v9zAym.mjs} +21 -62
- package/dist/.setup/{transcripts-source-DVegW0WI.mjs → transcripts-source-p8EV179h.mjs} +76 -235
- package/dist/.setup/{typing-BKZL5fGj.mjs → typing-BiHCzBRu.mjs} +2 -1
- package/dist/.setup/{voice-runtime-elTtjEIG.mjs → voice-runtime-B46rcwrG.mjs} +140 -244
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +18 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +4 -4
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +20 -20
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +15 -24
- package/dist/subagent-hooks-api.js +3 -4
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +20 -8
- package/node_modules/@types/node/ffi.d.ts +14 -0
- package/node_modules/@types/node/http2.d.ts +3 -2
- package/node_modules/@types/node/net.d.ts +16 -4
- package/node_modules/@types/node/package.json +2 -17
- package/node_modules/@types/node/process.d.ts +1 -0
- package/node_modules/@types/node/quic.d.ts +39 -1
- package/node_modules/@types/node/stream/iter.d.ts +9 -12
- package/node_modules/@types/node/test/reporters.d.ts +1 -0
- package/node_modules/@types/node/test.d.ts +72 -0
- package/node_modules/@types/node/tls.d.ts +14 -10
- package/node_modules/@types/node/vm.d.ts +2 -1
- package/node_modules/@types/node/worker_threads.d.ts +4 -1
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/openclaw.plugin.json +21 -1
- package/package.json +5 -5
- package/dist/.setup/agent-components.runtime-CEPrf2SY.mjs +0 -4
- package/dist/.setup/probe.runtime-DBQ_AGPe.mjs +0 -2
- package/dist/.setup/provider-session.runtime-DrGAYnZv.mjs +0 -6
- package/dist/.setup/provider.runtime-BmjW_pIw.mjs +0 -2
- package/dist/.setup/security-audit.runtime-DHtYenx9.mjs +0 -2
- package/dist/.setup/setup-plugin-api-Dvr41dyx.mjs +0 -3
- package/dist/.setup/system-events-B2YEEMbS.mjs +0 -34
- package/dist/.setup/targets-CvemhN3i.mjs +0 -3
- package/dist/.setup/thread-bindings.session-updates-DCQq1WZ5.mjs +0 -55
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-
|
|
2
|
-
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
3
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
4
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-ChaMcixG.mjs";
|
|
2
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-B3wZ4hN-.mjs";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BFPNRmVv.mjs";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-0-aBuCy3.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -9,11 +9,8 @@ import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSect
|
|
|
9
9
|
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
10
10
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
11
11
|
//#region extensions/discord/src/setup-account-state.ts
|
|
12
|
-
function resolveDefaultDiscordSetupAccountId(cfg) {
|
|
13
|
-
return resolveDefaultDiscordAccountId(cfg);
|
|
14
|
-
}
|
|
15
12
|
function resolveDiscordSetupAccountConfig(params) {
|
|
16
|
-
const accountId = normalizeAccountId(params.accountId ??
|
|
13
|
+
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
17
14
|
return {
|
|
18
15
|
accountId,
|
|
19
16
|
config: mergeDiscordAccountConfig(params.cfg, accountId)
|
|
@@ -213,7 +210,7 @@ async function resolveDiscordAllowFromEntries(params) {
|
|
|
213
210
|
async function promptDiscordAllowFrom(params) {
|
|
214
211
|
const accountId = resolveSetupAccountId({
|
|
215
212
|
accountId: params.accountId,
|
|
216
|
-
defaultAccountId:
|
|
213
|
+
defaultAccountId: resolveDefaultDiscordAccountId(params.cfg)
|
|
217
214
|
});
|
|
218
215
|
const account = resolveDiscordSetupAccountConfig({
|
|
219
216
|
cfg: params.cfg,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { B as Container, F as RadioGroup, G as RoleSelectMenu, H as LinkButton, I as TextInput, J as Separator, K as Row, L as AnySelectMenu, M as CheckboxGroup, N as Label, P as Modal, Q as UserSelectMenu, R as Button, U as MediaGallery, V as File, W as MentionableSelectMenu, X as TextDisplay, Y as StringSelectMenu, Z as Thumbnail, et as parseCustomId, q as Section, z as ChannelSelectMenu } from "./discord-0xJYfdDD.mjs";
|
|
2
3
|
import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
|
|
3
4
|
import crypto from "node:crypto";
|
|
4
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -103,29 +104,23 @@ function parseDiscordModalCustomId(id) {
|
|
|
103
104
|
function isDiscordComponentWildcardRegistrationId(id) {
|
|
104
105
|
return /^__openclaw_discord_component_[a-z_]+_wildcard__$/.test(id);
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
+
function parseDiscordCustomIdForInteraction(id, key) {
|
|
107
108
|
if (id === "*" || isDiscordComponentWildcardRegistrationId(id)) return {
|
|
108
109
|
key: "*",
|
|
109
110
|
data: {}
|
|
110
111
|
};
|
|
111
112
|
const parsed = parseCustomId(id);
|
|
112
|
-
if (parsed.key !==
|
|
113
|
+
if (parsed.key !== key) return parsed;
|
|
113
114
|
return {
|
|
114
115
|
key: "*",
|
|
115
116
|
data: decodeParsedCustomIdData(parsed.data)
|
|
116
117
|
};
|
|
117
118
|
}
|
|
119
|
+
function parseDiscordComponentCustomIdForInteraction(id) {
|
|
120
|
+
return parseDiscordCustomIdForInteraction(id, DISCORD_COMPONENT_CUSTOM_ID_KEY);
|
|
121
|
+
}
|
|
118
122
|
function parseDiscordModalCustomIdForInteraction(id) {
|
|
119
|
-
|
|
120
|
-
key: "*",
|
|
121
|
-
data: {}
|
|
122
|
-
};
|
|
123
|
-
const parsed = parseCustomId(id);
|
|
124
|
-
if (parsed.key !== "ocmodal") return parsed;
|
|
125
|
-
return {
|
|
126
|
-
key: "*",
|
|
127
|
-
data: decodeParsedCustomIdData(parsed.data)
|
|
128
|
-
};
|
|
123
|
+
return parseDiscordCustomIdForInteraction(id, DISCORD_MODAL_CUSTOM_ID_KEY);
|
|
129
124
|
}
|
|
130
125
|
//#endregion
|
|
131
126
|
//#region extensions/discord/src/components.parse.ts
|
|
@@ -174,19 +169,15 @@ function normalizeModalFieldName(value, index) {
|
|
|
174
169
|
if (trimmed) return trimmed;
|
|
175
170
|
return `field_${index + 1}`;
|
|
176
171
|
}
|
|
177
|
-
function
|
|
172
|
+
function readAttachmentName(value, label, filenameLabel = "a filename") {
|
|
178
173
|
const trimmed = value.trim();
|
|
179
174
|
if (!trimmed.startsWith("attachment://")) throw new Error(`${label} must start with "${DISCORD_COMPONENT_ATTACHMENT_PREFIX}"`);
|
|
180
175
|
const attachmentName = trimmed.slice(13).trim();
|
|
181
|
-
if (!attachmentName) throw new Error(`${label} must include
|
|
182
|
-
return
|
|
176
|
+
if (!attachmentName) throw new Error(`${label} must include ${filenameLabel}`);
|
|
177
|
+
return attachmentName;
|
|
183
178
|
}
|
|
184
179
|
function resolveDiscordComponentAttachmentName(value) {
|
|
185
|
-
|
|
186
|
-
if (!trimmed.startsWith("attachment://")) throw new Error(`Attachment reference must start with "${DISCORD_COMPONENT_ATTACHMENT_PREFIX}"`);
|
|
187
|
-
const attachmentName = trimmed.slice(13).trim();
|
|
188
|
-
if (!attachmentName) throw new Error("Attachment reference must include a filename");
|
|
189
|
-
return attachmentName;
|
|
180
|
+
return readAttachmentName(value, "Attachment reference");
|
|
190
181
|
}
|
|
191
182
|
function mapButtonStyle(style) {
|
|
192
183
|
switch (normalizeLowercaseStringOrEmpty(style ?? "primary")) {
|
|
@@ -200,10 +191,6 @@ function mapButtonStyle(style) {
|
|
|
200
191
|
function mapTextInputStyle(style) {
|
|
201
192
|
return style === "paragraph" ? TextInputStyle.Paragraph : TextInputStyle.Short;
|
|
202
193
|
}
|
|
203
|
-
function normalizeBlockType(raw) {
|
|
204
|
-
const lowered = normalizeLowercaseStringOrEmpty(raw);
|
|
205
|
-
return BLOCK_ALIASES.get(lowered) ?? lowered;
|
|
206
|
-
}
|
|
207
194
|
function parseSelectOptions(raw, label) {
|
|
208
195
|
if (raw === void 0) return;
|
|
209
196
|
if (!Array.isArray(raw)) throw new Error(`${label} must be an array`);
|
|
@@ -313,7 +300,8 @@ function parseModalField(raw, label, index) {
|
|
|
313
300
|
}
|
|
314
301
|
function parseComponentBlock(raw, label) {
|
|
315
302
|
const obj = requireObject(raw, label);
|
|
316
|
-
|
|
303
|
+
const typeRaw = normalizeLowercaseStringOrEmpty(readRequiredString(obj.type, `${label}.type`));
|
|
304
|
+
switch (BLOCK_ALIASES.get(typeRaw) ?? typeRaw) {
|
|
317
305
|
case "text": return {
|
|
318
306
|
type: "text",
|
|
319
307
|
text: readRequiredString(obj.text, `${label}.text`, false)
|
|
@@ -384,11 +372,14 @@ function parseComponentBlock(raw, label) {
|
|
|
384
372
|
})
|
|
385
373
|
};
|
|
386
374
|
}
|
|
387
|
-
case "file":
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
375
|
+
case "file": {
|
|
376
|
+
const file = readRequiredString(obj.file, `${label}.file`);
|
|
377
|
+
return {
|
|
378
|
+
type: "file",
|
|
379
|
+
file: `${DISCORD_COMPONENT_ATTACHMENT_PREFIX}${readAttachmentName(file, `${label}.file`, "an attachment filename")}`,
|
|
380
|
+
spoiler: typeof obj.spoiler === "boolean" ? obj.spoiler : void 0
|
|
381
|
+
};
|
|
382
|
+
}
|
|
392
383
|
default: throw new Error(`${label}.type must be a supported component block`);
|
|
393
384
|
}
|
|
394
385
|
}
|
|
@@ -564,9 +555,6 @@ function createSelectComponent(params) {
|
|
|
564
555
|
}
|
|
565
556
|
};
|
|
566
557
|
}
|
|
567
|
-
function isSelectComponent(component) {
|
|
568
|
-
return component instanceof StringSelectMenu || component instanceof UserSelectMenu || component instanceof RoleSelectMenu || component instanceof MentionableSelectMenu || component instanceof ChannelSelectMenu;
|
|
569
|
-
}
|
|
570
558
|
function buildDiscordComponentMessage(params) {
|
|
571
559
|
const entries = [];
|
|
572
560
|
const consumptionGroupId = createShortId("grp_");
|
|
@@ -674,12 +662,8 @@ function buildDiscordComponentMessage(params) {
|
|
|
674
662
|
});
|
|
675
663
|
if (entry) addEntry(entry);
|
|
676
664
|
const lastChild = containerChildren.at(-1);
|
|
677
|
-
if (lastChild instanceof Row)
|
|
678
|
-
|
|
679
|
-
const hasSelect = row.components.some((entryLocal) => isSelectComponent(entryLocal));
|
|
680
|
-
if (row.components.length < 5 && !hasSelect) row.addComponent(component);
|
|
681
|
-
else containerChildren.push(new Row([component]));
|
|
682
|
-
} else containerChildren.push(new Row([component]));
|
|
665
|
+
if (lastChild instanceof Row && lastChild.components.length < 5 && !lastChild.components.some((child) => child instanceof AnySelectMenu)) lastChild.addComponent(component);
|
|
666
|
+
else containerChildren.push(new Row([component]));
|
|
683
667
|
}
|
|
684
668
|
if (containerChildren.length === 0) throw new Error("components must include at least one block, text, or modal trigger");
|
|
685
669
|
const container = new Container(containerChildren, params.spec.container);
|
|
@@ -856,9 +840,6 @@ var shared_interactive_exports = /* @__PURE__ */ __exportAll({
|
|
|
856
840
|
buildDiscordInteractiveComponents: () => buildDiscordInteractiveComponents,
|
|
857
841
|
buildDiscordPresentationComponents: () => buildDiscordPresentationComponents
|
|
858
842
|
});
|
|
859
|
-
function resolveDiscordInteractiveButtonStyle(style) {
|
|
860
|
-
return style ?? "secondary";
|
|
861
|
-
}
|
|
862
843
|
function resolveDiscordSelectOptionValue(option) {
|
|
863
844
|
return resolveMessagePresentationActionValue(resolveMessagePresentationOptionAction(option));
|
|
864
845
|
}
|
|
@@ -873,15 +854,17 @@ const DISCORD_INTERACTIVE_BUTTON_ROW_SIZE = 5;
|
|
|
873
854
|
function buildDiscordButtonComponent(button, options) {
|
|
874
855
|
const action = resolveMessagePresentationButtonAction(button);
|
|
875
856
|
if (!action) return;
|
|
857
|
+
const component = {
|
|
858
|
+
label: button.label,
|
|
859
|
+
style: button.style ?? "secondary",
|
|
860
|
+
...button.disabled === true ? { disabled: true } : {}
|
|
861
|
+
};
|
|
876
862
|
if (action.type === "approval") {
|
|
877
863
|
const internalCustomId = buildDiscordApprovalCustomId(action);
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
internalCustomId,
|
|
883
|
-
...button.disabled === true ? { disabled: true } : {}
|
|
884
|
-
};
|
|
864
|
+
return internalCustomId ? {
|
|
865
|
+
...component,
|
|
866
|
+
internalCustomId
|
|
867
|
+
} : void 0;
|
|
885
868
|
}
|
|
886
869
|
if (action.type === "question") {
|
|
887
870
|
if ("intent" in action) return;
|
|
@@ -896,30 +879,19 @@ function buildDiscordButtonComponent(button, options) {
|
|
|
896
879
|
optionIndex
|
|
897
880
|
});
|
|
898
881
|
return internalCustomId ? {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
internalCustomId,
|
|
902
|
-
...button.disabled === true ? { disabled: true } : {}
|
|
882
|
+
...component,
|
|
883
|
+
internalCustomId
|
|
903
884
|
} : void 0;
|
|
904
885
|
}
|
|
905
|
-
if (action.type === "web-app" && action.widgetId && isValidDiscordActivityWidgetId(action.widgetId))
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
};
|
|
912
|
-
if (action.type === "web-app" && !action.url) return;
|
|
913
|
-
const component = {
|
|
914
|
-
label: button.label,
|
|
915
|
-
style: action.type === "url" || action.type === "web-app" ? "link" : resolveDiscordInteractiveButtonStyle(button.style)
|
|
916
|
-
};
|
|
917
|
-
if (action.type === "url" || action.type === "web-app") component.url = action.url;
|
|
918
|
-
else {
|
|
886
|
+
if (action.type === "web-app" && action.widgetId && isValidDiscordActivityWidgetId(action.widgetId)) component.internalCustomId = buildDiscordActivityCustomId(action.widgetId);
|
|
887
|
+
else if (action.type === "url" || action.type === "web-app") {
|
|
888
|
+
if (action.type === "web-app" && !action.url) return;
|
|
889
|
+
component.style = "link";
|
|
890
|
+
component.url = action.url;
|
|
891
|
+
} else {
|
|
919
892
|
component.callbackData = action.type === "command" ? action.command : action.value;
|
|
920
893
|
if (button.action?.type === "command" || button.action?.type === "callback") component.callbackDataKind = button.action.type;
|
|
921
894
|
}
|
|
922
|
-
if (button.disabled === true) component.disabled = true;
|
|
923
895
|
if (button.reusable === true) component.reusable = true;
|
|
924
896
|
return component;
|
|
925
897
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-CshUGl36.mjs";
|
|
1
2
|
import { normalizeLegacyDmAliases } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
2
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
4
|
import { buildSecretInputSchema, registerSensitiveConfigSchema } from "openclaw/plugin-sdk/secret-input";
|
|
4
5
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
5
|
-
import
|
|
6
|
-
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, TtsConfigSchema, buildChannelAccountSchemaParts, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildGroupEntrySchema, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
7
|
-
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
6
|
+
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, TtsConfigSchema, buildChannelAccountSchemaParts, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildGroupEntrySchema, refineChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-schema";
|
|
8
7
|
import { z } from "zod";
|
|
9
8
|
//#region extensions/discord/src/config-ui-hints.ts
|
|
10
9
|
const discordChannelConfigUiHints = {
|
|
@@ -40,6 +39,14 @@ const discordChannelConfigUiHints = {
|
|
|
40
39
|
label: "Discord Guild Join Introduction",
|
|
41
40
|
help: "Post one brief, room-specific introduction when the bot joins an allowed Discord guild (default: true). Account settings override the channel-wide setting."
|
|
42
41
|
},
|
|
42
|
+
"guilds.*.requireMentionInBotThreads": {
|
|
43
|
+
label: "Require Mention in Bot-Created Threads",
|
|
44
|
+
help: "Override mention gating only in threads owned by this bot. False allows unmentioned follow-ups; true requires a mention even with autoThread enabled. Omitted preserves existing behavior. Sender and channel access rules still apply."
|
|
45
|
+
},
|
|
46
|
+
"guilds.*.channels.*.requireMentionInBotThreads": {
|
|
47
|
+
label: "Require Mention in Bot-Created Threads",
|
|
48
|
+
help: "Override the guild setting for this channel. Applies only when Discord identifies this bot as the thread owner; unknown or other owners keep ordinary mention rules. Unmentioned messages require Message Content Intent."
|
|
49
|
+
},
|
|
43
50
|
proxy: {
|
|
44
51
|
label: "Discord Proxy URL",
|
|
45
52
|
help: "Proxy URL for Discord gateway + API requests (app-id lookup and allowlist resolution). Set per account via channels.discord.accounts.<id>.proxy."
|
|
@@ -275,7 +282,7 @@ const discordChannelConfigUiHints = {
|
|
|
275
282
|
},
|
|
276
283
|
allowBots: {
|
|
277
284
|
label: "Discord Allow Bot Messages",
|
|
278
|
-
help: "Allow bot-authored messages
|
|
285
|
+
help: "Allow bot-authored messages through normal Discord mention and access rules (default: true). Set false to disable bot-triggered turns, or \"mentions\" to require a bot mention. Accessible bot messages remain available as conversation context."
|
|
279
286
|
},
|
|
280
287
|
botLoopProtection: {
|
|
281
288
|
label: "Discord Bot Loop Protection",
|
|
@@ -326,42 +333,6 @@ const discordChannelConfigUiHints = {
|
|
|
326
333
|
};
|
|
327
334
|
//#endregion
|
|
328
335
|
//#region extensions/discord/src/config-schema.ts
|
|
329
|
-
const dmPolicySdk = channelConfigSchema;
|
|
330
|
-
function refineDiscordDmPolicyForHost(params) {
|
|
331
|
-
if (dmPolicySdk.refineChannelDmPolicy) {
|
|
332
|
-
dmPolicySdk.refineChannelDmPolicy({
|
|
333
|
-
channelId: "discord",
|
|
334
|
-
...params
|
|
335
|
-
});
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
const { value, accountId, ctx } = params;
|
|
339
|
-
const account = accountId === void 0 ? value : value.accounts?.[accountId];
|
|
340
|
-
if (!account) return;
|
|
341
|
-
const policy = account.dmPolicy ?? value.dmPolicy;
|
|
342
|
-
const allowFrom = account.allowFrom ?? value.allowFrom;
|
|
343
|
-
const owner = accountId === void 0 ? "channels.discord" : "channels.discord.accounts.*";
|
|
344
|
-
const inherited = accountId === void 0 ? "" : " (or channels.discord.allowFrom)";
|
|
345
|
-
const path = accountId === void 0 ? ["allowFrom"] : [
|
|
346
|
-
"accounts",
|
|
347
|
-
accountId,
|
|
348
|
-
"allowFrom"
|
|
349
|
-
];
|
|
350
|
-
requireOpenAllowFrom({
|
|
351
|
-
policy,
|
|
352
|
-
allowFrom,
|
|
353
|
-
ctx,
|
|
354
|
-
path,
|
|
355
|
-
message: `${owner}.dmPolicy="${policy}" requires ${owner}.allowFrom${inherited} to include "*"`
|
|
356
|
-
});
|
|
357
|
-
requireAllowlistAllowFrom({
|
|
358
|
-
policy,
|
|
359
|
-
allowFrom,
|
|
360
|
-
ctx,
|
|
361
|
-
path,
|
|
362
|
-
message: `${owner}.dmPolicy="${policy}" requires ${owner}.allowFrom${inherited} to contain at least one sender ID`
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
336
|
const SecretInputSchema = buildSecretInputSchema();
|
|
366
337
|
const DiscordPreviewStreamingConfigSchema = ChannelPreviewStreamingConfigSchema.extend({ progress: ChannelStreamingProgressSchema.optional() }).strict();
|
|
367
338
|
const DiscordIdSchema = z.union([z.string(), z.number()]).transform((value, ctx) => {
|
|
@@ -394,6 +365,7 @@ const DiscordPresenceEventsSchema = z.object({
|
|
|
394
365
|
}).strict();
|
|
395
366
|
const DiscordThreadSchema = z.object({ inheritParent: z.boolean().optional() }).strict();
|
|
396
367
|
const DiscordGuildChannelSchema = buildGroupEntrySchema({
|
|
368
|
+
requireMentionInBotThreads: z.boolean().optional(),
|
|
397
369
|
ignoreOtherMentions: z.boolean().optional(),
|
|
398
370
|
users: DiscordIdListSchema.optional(),
|
|
399
371
|
roles: DiscordIdListSchema.optional(),
|
|
@@ -416,6 +388,7 @@ const DiscordGuildChannelSchema = buildGroupEntrySchema({
|
|
|
416
388
|
]).optional()
|
|
417
389
|
}, { omit: ["allowFrom"] });
|
|
418
390
|
const DiscordGuildSchema = buildGroupEntrySchema({
|
|
391
|
+
requireMentionInBotThreads: z.boolean().optional(),
|
|
419
392
|
slug: z.string().optional(),
|
|
420
393
|
ignoreOtherMentions: z.boolean().optional(),
|
|
421
394
|
...buildChannelReactionShape({ notificationModes: [
|
|
@@ -633,14 +606,14 @@ const DiscordAccountSchemaBase = z.object({
|
|
|
633
606
|
});
|
|
634
607
|
});
|
|
635
608
|
function normalizeShippedDiscordDmAliases(value) {
|
|
636
|
-
const entry = asObjectRecord(value);
|
|
609
|
+
const entry = (0, runtime_doctor_migrations_exports.asObjectRecord)(value);
|
|
637
610
|
if (!entry) return value;
|
|
638
611
|
const updated = normalizeLegacyDmAliases({
|
|
639
612
|
entry,
|
|
640
613
|
pathPrefix: "channels.discord",
|
|
641
614
|
changes: []
|
|
642
615
|
}).entry;
|
|
643
|
-
const dm = asObjectRecord(updated.dm);
|
|
616
|
+
const dm = (0, runtime_doctor_migrations_exports.asObjectRecord)(updated.dm);
|
|
644
617
|
if (!dm || dm.policy === void 0 && dm.allowFrom === void 0) return updated;
|
|
645
618
|
const { policy: _policy, allowFrom: _allowFrom, ...retainedDm } = dm;
|
|
646
619
|
const { dm: _dm, ...rest } = updated;
|
|
@@ -655,14 +628,16 @@ const DiscordConfigSchemaBase = DiscordAccountSchemaBase.safeExtend({
|
|
|
655
628
|
accounts: z.record(z.string(), DiscordAccountSchema.optional()).optional(),
|
|
656
629
|
defaultAccount: z.string().optional()
|
|
657
630
|
}).superRefine((value, ctx) => {
|
|
658
|
-
|
|
631
|
+
refineChannelDmPolicy({
|
|
632
|
+
channelId: "discord",
|
|
659
633
|
value,
|
|
660
634
|
ctx
|
|
661
635
|
});
|
|
662
636
|
if (!value.accounts) return;
|
|
663
637
|
for (const [accountId, account] of Object.entries(value.accounts)) {
|
|
664
638
|
if (!account) continue;
|
|
665
|
-
|
|
639
|
+
refineChannelDmPolicy({
|
|
640
|
+
channelId: "discord",
|
|
666
641
|
value,
|
|
667
642
|
accountId,
|
|
668
643
|
ctx
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { m as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-
|
|
1
|
+
import { m as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-zVGxxceg.mjs";
|
|
2
2
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
4
|
//#region extensions/discord/src/monitor/conversation-binding-route.ts
|
|
5
5
|
function resolveDiscordConversationBindingRoute(params) {
|
|
6
|
+
let baseRoute;
|
|
6
7
|
let runtimeRoute = resolveRuntimeConversationBindingRoute({
|
|
7
|
-
|
|
8
|
+
resolveRoute: (selection) => {
|
|
9
|
+
baseRoute = params.resolveRoute(selection);
|
|
10
|
+
return baseRoute;
|
|
11
|
+
},
|
|
8
12
|
touchBinding: params.touchBinding,
|
|
9
13
|
conversation: {
|
|
10
14
|
channel: "discord",
|
|
@@ -13,17 +17,18 @@ function resolveDiscordConversationBindingRoute(params) {
|
|
|
13
17
|
parentConversationId: params.parentConversationId
|
|
14
18
|
}
|
|
15
19
|
});
|
|
20
|
+
const route = baseRoute ?? runtimeRoute.route;
|
|
16
21
|
if (shouldIgnoreStaleDiscordRouteBinding({
|
|
17
22
|
bindingRecord: runtimeRoute.bindingRecord,
|
|
18
|
-
route
|
|
23
|
+
route
|
|
19
24
|
})) {
|
|
20
|
-
logVerbose(`discord: ignoring stale route binding for conversation ${params.runtimeConversationId} (${runtimeRoute.bindingRecord?.targetSessionKey} -> ${
|
|
25
|
+
logVerbose(`discord: ignoring stale route binding for conversation ${params.runtimeConversationId} (${runtimeRoute.bindingRecord?.targetSessionKey} -> ${route.sessionKey})`);
|
|
21
26
|
runtimeRoute = {
|
|
22
27
|
bindingOwnerAvailable: true,
|
|
23
28
|
bindingRecord: null,
|
|
24
29
|
route: {
|
|
25
30
|
...runtimeRoute.route,
|
|
26
|
-
...
|
|
31
|
+
...route
|
|
27
32
|
}
|
|
28
33
|
};
|
|
29
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-ChaMcixG.mjs";
|
|
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
|
|
@@ -9,20 +9,17 @@ var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
|
9
9
|
});
|
|
10
10
|
function resolveDiscordDirectoryConfigAccount(cfg, accountId) {
|
|
11
11
|
const resolvedAccountId = normalizeAccountId(accountId ?? resolveDefaultDiscordAccountId(cfg));
|
|
12
|
-
const config = mergeDiscordAccountConfig(cfg, resolvedAccountId);
|
|
13
12
|
return {
|
|
14
|
-
|
|
15
|
-
config,
|
|
13
|
+
config: mergeDiscordAccountConfig(cfg, resolvedAccountId),
|
|
16
14
|
allowFrom: resolveDiscordAccountAllowFrom({
|
|
17
15
|
cfg,
|
|
18
16
|
accountId: resolvedAccountId
|
|
19
|
-
}) ?? []
|
|
20
|
-
dm: config.dm
|
|
17
|
+
}) ?? []
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
20
|
const listDiscordDirectoryPeersFromConfig = createResolvedDirectoryEntriesLister({
|
|
24
21
|
kind: "user",
|
|
25
|
-
resolveAccount:
|
|
22
|
+
resolveAccount: resolveDiscordDirectoryConfigAccount,
|
|
26
23
|
resolveSources: (account) => {
|
|
27
24
|
const guildUsers = Object.values(account.config.guilds ?? {}).flatMap((guild) => (guild.users ?? []).concat(Object.values(guild.channels ?? {}).flatMap((channel) => channel.users ?? [])));
|
|
28
25
|
return [
|
|
@@ -38,7 +35,7 @@ const listDiscordDirectoryPeersFromConfig = createResolvedDirectoryEntriesLister
|
|
|
38
35
|
});
|
|
39
36
|
const listDiscordDirectoryGroupsFromConfig = createResolvedDirectoryEntriesLister({
|
|
40
37
|
kind: "group",
|
|
41
|
-
resolveAccount:
|
|
38
|
+
resolveAccount: resolveDiscordDirectoryConfigAccount,
|
|
42
39
|
resolveSources: (account) => Object.values(account.config.guilds ?? {}).map((guild) => Object.keys(guild.channels ?? {})),
|
|
43
40
|
normalizeId: (raw) => {
|
|
44
41
|
const cleaned = (raw.match(/^<#(\d+)>$/)?.[1] ?? raw).replace(/^(discord|channel|group):/i, "").trim();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as normalizeDiscordSlug } from "./channel-type-
|
|
3
|
-
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-
|
|
4
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { o as normalizeDiscordSlug } from "./channel-type-DRCrEMss.mjs";
|
|
3
|
+
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-ChaMcixG.mjs";
|
|
4
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DVbJwZVt.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
//#region extensions/discord/src/directory-cache-state.ts
|
|
@@ -70,12 +70,6 @@ var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
|
70
70
|
listDiscordDirectoryGroupsLive: () => listDiscordDirectoryGroupsLive,
|
|
71
71
|
listDiscordDirectoryPeersLive: () => listDiscordDirectoryPeersLive
|
|
72
72
|
});
|
|
73
|
-
function normalizeQuery(value) {
|
|
74
|
-
return normalizeOptionalLowercaseString(value) ?? "";
|
|
75
|
-
}
|
|
76
|
-
function buildUserRank(user) {
|
|
77
|
-
return user.bot ? 0 : 1;
|
|
78
|
-
}
|
|
79
73
|
function resolveDiscordDirectoryAccess(params) {
|
|
80
74
|
const account = resolveDiscordAccount({
|
|
81
75
|
cfg: params.cfg,
|
|
@@ -85,7 +79,7 @@ function resolveDiscordDirectoryAccess(params) {
|
|
|
85
79
|
if (!token) return null;
|
|
86
80
|
return {
|
|
87
81
|
token,
|
|
88
|
-
query:
|
|
82
|
+
query: normalizeOptionalLowercaseString(params.query) ?? "",
|
|
89
83
|
accountId: account.accountId
|
|
90
84
|
};
|
|
91
85
|
}
|
|
@@ -152,7 +146,7 @@ async function listDiscordDirectoryPeersLive(params) {
|
|
|
152
146
|
id: `user:${user.id}`,
|
|
153
147
|
name: name || void 0,
|
|
154
148
|
handle: user.username ? `@${user.username}` : void 0,
|
|
155
|
-
rank:
|
|
149
|
+
rank: user.bot ? 0 : 1,
|
|
156
150
|
raw: member
|
|
157
151
|
});
|
|
158
152
|
if (rows.length >= limit) return rows;
|