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

159
Vistas
en el mensaje de error bot.on('mensaje', async (msg) => { if (msg.author.bot) return; await msg.replay() });

Recibo este error si escribo algo y el bot no envía nada.

 (node:1596) DeprecationWarning: The message event is deprecated. Use messageCreate instead (Use `node --trace-deprecation ...` to show where the warning was created) file:///C:/Users/name/Desktop/Projekte/Neo%201PG/src/bot.js:9 await msg.replay() ^ TypeError: msg.replay is not a function

Código:

 import { Client, Intents } from 'discord.js'; export const bot = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] }); bot.on('ready', () => console.log(`${bot.user.username} is online`)) bot.on('message', async (msg) => { if (msg.author.bot) return; await msg.replay() });
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Hay 3 problemas aquí:

  • El evento de message ha quedado obsoleto desde Discord.JS v13 como se indica en los registros. Debe cambiarle el nombre a messageCreate .

  • Escribiste mal la reply como replay .

  • La función msg.reply() necesita que se pase una cadena como parámetro. No se puede utilizar con un parámetro void.

Su evento messageCreate debería verse así:

 bot.on('messageCreate', async (msg) => { if (msg.author.bot) return; await msg.reply('My message content!') });
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