• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

395
Views
¿Cómo envío un archivo TXT en Discord.js?

¿Cómo envío un archivo txt en discord.js como archivo adjunto? Como esto: ingrese la descripción de la imagen aquí

He probado el siguiente código:

 let content = nsOpts.Tcontent fs.writeFileSync('./nosleep.txt', content) let atc = new discord.MessageAttachment('nosleep.txt') interaction.channel.send('here ya go,', { files: [atc, 'nosleep.txt', './nosleep.txt', 'attachment://nosleep.txt']})

Pero el bot solo envía el mensaje, no el archivo.

ingrese la descripción de la imagen aquí

Gracias

about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba esto.

 const fs = require('fs'); var atc = fs.readFileSync('./nosleep.txt', {"encoding": "utf-8"});
about 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error