Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
message.author.id returning bot id

I am trying to make a modmail system and whenever it creates a ticket, it logs your id in quick.db (for sending messages from the dm to the support ticket), Although, whenever I try to do that, it returns the ID for the bot.

Here is the code I use

client.on('message', message => {
  if(db.has(`ticket-${message.author.id}`)){
    console.log(message.author.id)
    if(message.channel.type == "dm"){
      const channel = client.channels.cache.find(c => c.name === `ticket-${message.author.id}` && c.type === 'text');
      channel.send(message.content)
    }
  }
})

Whenever I open a ticket and send something it sends the bots id in the console, not my own. I am using version 12 for this project

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

channel.send(message.content) emits the message event just like any other user message. To ignore bot messages add

if (message.author.bot) return; 

To the top of your message listener.

client.on('message', message => {
   if (message.author.bot) return;
   // Your Code ...
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda