@songsid/agend-plugin-discord 0.0.1 → 0.0.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/package.json +1 -1
- package/src/discord-adapter.ts +1 -1
package/package.json
CHANGED
package/src/discord-adapter.ts
CHANGED
|
@@ -549,7 +549,7 @@ export class DiscordAdapter extends EventEmitter implements ChannelAdapter {
|
|
|
549
549
|
if (!url) throw new Error(`No URL for attachment: ${fileId}`);
|
|
550
550
|
const response = await fetch(url);
|
|
551
551
|
if (!response.ok) throw new Error(`Download failed: ${response.status}`);
|
|
552
|
-
const filename = fileId
|
|
552
|
+
const filename = `${Date.now()}-${fileId.slice(-8)}-${url.split("/").pop()?.split("?")[0] ?? "file"}`;
|
|
553
553
|
const localPath = join(this.inboxDir, filename);
|
|
554
554
|
const dest = createWriteStream(localPath);
|
|
555
555
|
const body = response.body;
|