@openclaw/discord 2026.1.29 → 2026.2.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/index.ts +0 -1
- package/openclaw.plugin.json +1 -3
- package/package.json +5 -2
- package/src/channel.ts +9 -9
package/index.ts
CHANGED
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "2026.2.2",
|
|
5
4
|
"description": "OpenClaw Discord channel plugin",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"openclaw": "workspace:*"
|
|
8
|
+
},
|
|
6
9
|
"openclaw": {
|
|
7
10
|
"extensions": [
|
|
8
11
|
"./index.ts"
|
package/src/channel.ts
CHANGED
|
@@ -26,15 +26,13 @@ import {
|
|
|
26
26
|
type ChannelPlugin,
|
|
27
27
|
type ResolvedDiscordAccount,
|
|
28
28
|
} from "openclaw/plugin-sdk";
|
|
29
|
-
|
|
30
29
|
import { getDiscordRuntime } from "./runtime.js";
|
|
31
30
|
|
|
32
31
|
const meta = getChatChannelMeta("discord");
|
|
33
32
|
|
|
34
33
|
const discordMessageActions: ChannelMessageActionAdapter = {
|
|
35
34
|
listActions: (ctx) => getDiscordRuntime().channel.discord.messageActions.listActions(ctx),
|
|
36
|
-
extractToolSend: (ctx) =>
|
|
37
|
-
getDiscordRuntime().channel.discord.messageActions.extractToolSend(ctx),
|
|
35
|
+
extractToolSend: (ctx) => getDiscordRuntime().channel.discord.messageActions.extractToolSend(ctx),
|
|
38
36
|
handleAction: async (ctx) =>
|
|
39
37
|
await getDiscordRuntime().channel.discord.messageActions.handleAction(ctx),
|
|
40
38
|
};
|
|
@@ -281,8 +279,7 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount> = {
|
|
|
281
279
|
textChunkLimit: 2000,
|
|
282
280
|
pollMaxOptions: 10,
|
|
283
281
|
sendText: async ({ to, text, accountId, deps, replyToId }) => {
|
|
284
|
-
const send =
|
|
285
|
-
deps?.sendDiscord ?? getDiscordRuntime().channel.discord.sendMessageDiscord;
|
|
282
|
+
const send = deps?.sendDiscord ?? getDiscordRuntime().channel.discord.sendMessageDiscord;
|
|
286
283
|
const result = await send(to, text, {
|
|
287
284
|
verbose: false,
|
|
288
285
|
replyTo: replyToId ?? undefined,
|
|
@@ -291,8 +288,7 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount> = {
|
|
|
291
288
|
return { channel: "discord", ...result };
|
|
292
289
|
},
|
|
293
290
|
sendMedia: async ({ to, text, mediaUrl, accountId, deps, replyToId }) => {
|
|
294
|
-
const send =
|
|
295
|
-
deps?.sendDiscord ?? getDiscordRuntime().channel.discord.sendMessageDiscord;
|
|
291
|
+
const send = deps?.sendDiscord ?? getDiscordRuntime().channel.discord.sendMessageDiscord;
|
|
296
292
|
const result = await send(to, text, {
|
|
297
293
|
verbose: false,
|
|
298
294
|
mediaUrl,
|
|
@@ -334,7 +330,9 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount> = {
|
|
|
334
330
|
cfg,
|
|
335
331
|
accountId: account.accountId,
|
|
336
332
|
});
|
|
337
|
-
if (!channelIds.length && unresolvedChannels === 0)
|
|
333
|
+
if (!channelIds.length && unresolvedChannels === 0) {
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
338
336
|
const botToken = account.token?.trim();
|
|
339
337
|
if (!botToken) {
|
|
340
338
|
return {
|
|
@@ -386,7 +384,9 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount> = {
|
|
|
386
384
|
includeApplication: true,
|
|
387
385
|
});
|
|
388
386
|
const username = probe.ok ? probe.bot?.username?.trim() : null;
|
|
389
|
-
if (username)
|
|
387
|
+
if (username) {
|
|
388
|
+
discordBotLabel = ` (@${username})`;
|
|
389
|
+
}
|
|
390
390
|
ctx.setStatus({
|
|
391
391
|
accountId: account.accountId,
|
|
392
392
|
bot: probe.bot,
|