Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
Discord JS attachment

What im trying to do is basically let the bot upload the .db file on discord.

what i tried:

if(cmd == "backup"){
  message.channel.send(moment().format('YYYY/MM/D hh:mm:ss SSS'),{files:['./data/db.db']})
}

which would just send the formatted date without the file, and then i tried:

if(cmd == "backup"){
  const file = new MessageAttachment('./data/db.db')
  message.channel.send(file)
}

which would just give an error of an empty message.

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

0

if(cmd == "backup"){
  const moment = require('moment')
  message.channel.send({content: "> DB backup: "+moment().format('YYYY/MM/D hh:mm:ss SSS'), files: [
    { attachment: './data/db.db' }
]})
}
about 4 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!