Sending file without file

Hello, i want to send a string as a file, how can i do that?
8 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Kryp Arnold
Kryp Arnold2y ago
sometimes when you have more than 2000 characters in a message discord converts it to a file how can i do that on a bot
MrMythical
MrMythical2y ago
new AttachmentBuilder(Buffer.from(text)) and send it as a file
Kryp Arnold
Kryp Arnold2y ago
i'll try it
Kryp Arnold
Kryp Arnold2y ago
Kryp Arnold
Kryp Arnold2y ago
it gives that error and here is my code
bot.on(Events.MessageCreate, async message => {
if(message.author.bot)return;
const content = "string content";
const att = new AttachmentBuilder(Buffer.from(content))
await message.channel.send({content:"file",attachments:[att]})
});
bot.on(Events.MessageCreate, async message => {
if(message.author.bot)return;
const content = "string content";
const att = new AttachmentBuilder(Buffer.from(content))
await message.channel.send({content:"file",attachments:[att]})
});
MrMythical
MrMythical2y ago
files: [att]
Kryp Arnold
Kryp Arnold2y ago
ohh thank you so much
Want results from more Discord servers?
Add your server