Skip to content

Commit

Permalink
Include forwarded assets
Browse files Browse the repository at this point in the history
Closes #1023
  • Loading branch information
Glazelf committed Jan 14, 2025
1 parent 59af206 commit 6196e34
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions commands/info/messageAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ export default async (interaction, messageFlags) => {
let returnString = `Here's the assets you requested.\n`;
let message = interaction.options._hoistedOptions[0].message;

const messageHasStickers = message.stickers.size > 0;
const messageHasAttachments = message.attachments.size > 0;
let messageStickers = message.stickers;
let messageAttachments = message.attachments;
message.messageSnapshots.forEach(snapshot => {
messageStickers = messageStickers.concat(snapshot.stickers);
messageAttachments = messageAttachments.concat(snapshot.attachments);
});

const messageHasStickers = messageStickers.size > 0;
const messageHasAttachments = messageAttachments.size > 0;
if (!messageHasAttachments && !messageHasStickers) return sendMessage({ interaction: interaction, content: noAssetsString, flags: messageFlags });

if (messageHasStickers) returnString += `Sticker(s):\n${addAttachmentString(message.stickers)}\n`;
if (messageHasAttachments) returnString += `Attachment(s):\n${addAttachmentString(message.attachments)}\n`;
if (messageHasStickers) returnString += `Sticker(s):\n${addAttachmentString(messageStickers)}\n`;
if (messageHasAttachments) returnString += `Attachment(s):\n${addAttachmentString(messageAttachments)}\n`;
return sendMessage({ interaction: interaction, content: returnString, flags: messageFlags });
};

Expand Down

0 comments on commit 6196e34

Please sign in to comment.