discord attachment fix yup

This commit is contained in:
ChomeNS 2023-03-13 11:00:06 +07:00
parent e8ef5d8082
commit 8332c2c15d

View file

@ -39,13 +39,15 @@ async function inject (bot, dcclient, config) {
try { try {
const attachmentsComponent = [] const attachmentsComponent = []
if (message.attachments) { if (message.attachments) {
for (const value of message.attachments) { for (const __attachment of message.attachments) {
const _attachment = [...__attachment]
const attachment = _attachment[1] // BEST WAY REAL!?/1?!
attachmentsComponent.push({ attachmentsComponent.push({
text: message.content === '' ? '[Attachment]' : ' [Attachment]', // may not be the best fix text: message.content === '' ? '[Attachment]' : ' [Attachment]', // may not be the best fix
color: 'green', color: 'green',
clickEvent: { clickEvent: {
action: 'open_url', action: 'open_url',
value: value.proxyURL value: attachment.proxyURL
} }
}) })
} }