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

181
Views
Solo responde en dms discord.js

Así que estaba trabajando en este proyecto en el que la gente enviaría un DM al BOT y ejecutaría el comando y respondería a la prueba. Pero no responde.

 client.on("messageCreate", async message => { if (message.content.startsWith(prefix)) { const args = message.content.slice(prefix.length).trim().split(/ +/g); const command = args.shift().toLowerCase(); if (message.channel.type === 'dm') { message.reply("test"); } } });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Eso es porque no habilitó las intenciones para recibir un mensaje de dm, intente poner esos dos en las declaraciones de su cliente:

 const client = new Discord.Client({ intents : ['DIRECT_MESSAGES','GUILD_MESSAGES'], partials: ["CHANNEL","MESSAGE"] })
about 4 years ago · Juan Pablo Isaza Report

0

aquí hay una manera:

1. Cree un archivo llamado ** 'privateMessage.js'** y en el archivo principal agregue:

 const privateMessage = require('./privateMessage') client.on('ready' ,() =>{ console.log('I am online') client.user.setActivity('YouTube Music 🎧', {type:'PLAYING'}) privateMessage(client, 'ping', 'pong') })

y en el archivo que acabamos de crear privateMessage.js agregue:

 module.exports=(client, triggerText, replyText)=>{ client.on('message', message =>{ if(message.content.toLowerCase()===triggerText.toLowerCase()){ message.author.send(replyText) } }) }
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!