@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songsid/agend-plugin-discord",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Discord channel adapter plugin for AgEnD",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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 + "_" + (url.split("/").pop()?.split("?")[0] ?? "file");
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;