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

205
Vistas
Interaction handler for Discord.js buttons v13

I've been following guides for the past few days and saw this code for commands. Is there a way to make this for buttons to?

if (interaction.isCommand()) {
        const command = client.commands.get(interaction.commandName);
        if (!command) return interaction.followUp({ content: "This command no longer exists." }) && client.commands.delete(interaction.commandName);

        const arguments = [];

        for (let option of interaction.options.data) {
            if (option.type === 'SUB_COMMAND') {
                option.options?.forEach((x) => {
                    if (x.value) arguments.push(option.value);
                });
            } else if (option.value) arguments.push(option.value);
        };

        command.execute(client, interaction, arguments);
    }
about 4 years ago · Juan Pablo Isaza
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