This snippet will help you insert your message in attachment. To use, write prefix and space, then your message (eg. !attachment Hello, how are you doing?)
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const fileName = `from-${context.params.event.author.username}.txt`; //This will be the file name of the attachment
const message = context.params.event.content.split(' ').slice(1).join(' ');
const CHANNEL_ID = context.params.event.channel_id;
await lib.discord.channels['@0.3.2'].messages.create({
channel_id: `${CHANNEL_ID}`,
content: ``,
attachments: [
{
file: Buffer.from(message),
filename: `${fileName}`,
description: ``,
},
],
});