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

235
Vistas
Discord.js bot reply with slash command

I have a working slash command, which is great. I can use the command with one input parameter eg /command string and it will execute the command. However I am looking to set up a Discord bot that uses that command in a channel every 5 or so minutes. I can't seem to get the bot to use the command, any ideas on how to get it to work?

It just displays the string in the channel but the bot doesn't execute the command.

bot.on('messageCreate', async (msg) => {
    if (msg.content === "!loop") {
        interval = setInterval (function () {
            msg.channel.send("/command string")
        }, 3 * 1000);
    }
})
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Bots can only receive Application Command Interactions, not create them. This means your bot won't be able to run other bot's slash commands, click their buttons or use their dropdown menus.

If you have control over the other bot's code, though, you can set it up to listen for messages (not interactions) from your second bot, and run code accordingly.

But be aware: as MegaMix mentioned in their comment, if the bot you want to control isn't yours, you probably won't be able to do that, as it is a best practice to ignore messages from other bots to prevent abuse and infinite loops.

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