@songsid/agend-plugin-discord 0.0.3 → 0.0.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/dist/discord-adapter.js +2 -2
- package/package.json +2 -2
- package/src/discord-adapter.ts +3 -3
- package/src/index.ts +3 -3
package/dist/discord-adapter.js
CHANGED
|
@@ -6,7 +6,7 @@ import { pipeline } from "node:stream/promises";
|
|
|
6
6
|
import { Readable } from "node:stream";
|
|
7
7
|
import { createWriteStream } from "node:fs";
|
|
8
8
|
import { Client, GatewayIntentBits, ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, } from "discord.js";
|
|
9
|
-
import { MessageQueue } from "@
|
|
9
|
+
import { MessageQueue } from "@songsid/agend/channel/message-queue";
|
|
10
10
|
const DISCORD_MAX_LENGTH = 2000;
|
|
11
11
|
export class DiscordAdapter extends EventEmitter {
|
|
12
12
|
type = "discord";
|
|
@@ -490,7 +490,7 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
490
490
|
const response = await fetch(url);
|
|
491
491
|
if (!response.ok)
|
|
492
492
|
throw new Error(`Download failed: ${response.status}`);
|
|
493
|
-
const filename = fileId
|
|
493
|
+
const filename = `${Date.now()}-${fileId.slice(-8)}-${url.split("/").pop()?.split("?")[0] ?? "file"}`;
|
|
494
494
|
const localPath = join(this.inboxDir, filename);
|
|
495
495
|
const dest = createWriteStream(localPath);
|
|
496
496
|
const body = response.body;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@songsid/agend-plugin-discord",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Discord channel adapter plugin for AgEnD",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"build": "tsc"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@songsid/agend": ">=
|
|
12
|
+
"@songsid/agend": ">=1.13.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"discord.js": "^14.25.1"
|
package/src/discord-adapter.ts
CHANGED
|
@@ -24,9 +24,9 @@ import type {
|
|
|
24
24
|
PermissionPrompt,
|
|
25
25
|
Choice,
|
|
26
26
|
AlertData,
|
|
27
|
-
} from "@
|
|
28
|
-
import type { AccessManager } from "@
|
|
29
|
-
import { MessageQueue } from "@
|
|
27
|
+
} from "@suzuke/agend/channel";
|
|
28
|
+
import type { AccessManager } from "@suzuke/agend/channel/access-manager";
|
|
29
|
+
import { MessageQueue } from "@suzuke/agend/channel/message-queue";
|
|
30
30
|
|
|
31
31
|
const DISCORD_MAX_LENGTH = 2000;
|
|
32
32
|
|
package/src/index.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* channel:
|
|
8
8
|
* type: discord
|
|
9
9
|
*/
|
|
10
|
-
import type { ChannelAdapter } from "@
|
|
11
|
-
import type { ChannelConfig } from "@
|
|
12
|
-
import type { AccessManager } from "@
|
|
10
|
+
import type { ChannelAdapter } from "@suzuke/agend/channel";
|
|
11
|
+
import type { ChannelConfig } from "@suzuke/agend/types";
|
|
12
|
+
import type { AccessManager } from "@suzuke/agend/channel/access-manager";
|
|
13
13
|
import { DiscordAdapter } from "./discord-adapter.js";
|
|
14
14
|
|
|
15
15
|
interface AdapterOpts {
|