Skip to content

Commit 9b645f4

Browse files
committed
Stream attachments from discord to log them
1 parent a542e39 commit 9b645f4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/embeds/MessageDeleteEmbed.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import EmbedWrapper from './EmbedWrapper.js';
22
import colors from '../util/colors.js';
33
import {AttachmentBuilder, escapeMarkdown} from 'discord.js';
44
import {EMBED_DESCRIPTION_LIMIT} from '../util/apiLimits.js';
5+
import got from 'got';
56

67
export default class MessageDeleteEmbed extends EmbedWrapper {
78
#files = [];
@@ -31,8 +32,8 @@ export default class MessageDeleteEmbed extends EmbedWrapper {
3132
}
3233
}
3334

34-
for (const attachment of message.attachments.values()) {
35-
this.#files.push(new AttachmentBuilder(attachment.attachment)
35+
for (/** @type {import('discord.js').Attachment} */ const attachment of message.attachments.values()) {
36+
this.#files.push(new AttachmentBuilder(got.stream(attachment.proxyURL))
3637
.setDescription(attachment.description)
3738
.setName(attachment.name)
3839
.setSpoiler(true));
@@ -44,4 +45,4 @@ export default class MessageDeleteEmbed extends EmbedWrapper {
4445
message.files = this.#files;
4546
return message;
4647
}
47-
}
48+
}

0 commit comments

Comments
 (0)