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

138
Views
cómo hacer que mi bot mencione a la persona que le dio ese comando al bot

Estoy creando un bot de discordia y quiero hacer esto: alguien escribe -ping y el bot responde con @theuserwhotyped-ping .

No tengo errores, simplemente no sé cómo codificarlo, y no encuentro ninguna solución en Internet.

Aquí está el código que hice:

 const Discord = require("discord.js"); const client = new Discord.Client(); const prefix = "-"; client.on("message", message=>{ if(!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).split(" "); const command = args.shift().toLowerCase(); if (command === "ping"){ message.channel.send("@{user}); //this is the line which dont work } });
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puedes usar message.reply :

 message.reply('typed ping');

Envía una respuesta, como @peter, typed ping .

O use el message.author :

 message.channel.send(`${message.author} typed ping`);

Envía un mensaje como @peter typed ping .

over 4 years ago · Santiago Trujillo 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!