Attachments by URL
Attach a remote file with files: [{ name, url }] instead of downloading first.
When the file already lives on the web, pass a URL. The REST layer fetches it for the upload.
javascript
await message.reply({
content: 'Image from the web:',
files: [
{
name: 'photo.jpg',
url: 'https://www.w3schools.com/html/pic_trulli.jpg',
},
],
});Works on reply, send, channel send, and webhook send. You still need a filename so Fluxer knows how to present the attachment.
Combine with local buffers in the same files array if you want. Spoiler / metadata flags still go through the attachments array keyed by index (see File Attachments).
Runnable: attachments-bot (!urlfile) and !attachurl in ping-bot.