Handle attachments

This commit is contained in:
Wizzard 2024-02-05 17:32:33 -05:00
parent be83e1361f
commit 6fc18624e2
1 changed files with 6 additions and 1 deletions

View File

@ -20,8 +20,13 @@ client.on('messageCreate', async message => {
if (message.author.id === client.user.id) return;
const timestamp = new Date(message.createdTimestamp).toISOString();
let attachmentUrls = message.attachments.map(a => a.url).join(' ');
if (attachmentUrls) {
attachmentUrls = ' ' + attachmentUrls;
}
const formattedMessage = {
content: `<@${message.author.id}> / **${message.author.tag}**: ${message.content} \`${timestamp}\``,
content: `<@${message.author.id}> / **${message.author.tag}**: ${message.content}${attachmentUrls} \`${timestamp}\``,
target: channelMappings[message.channel.id]
};