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

190
Vistas
Application didn't respond while starting ban command (discord.js)

I tried to create a ban command, but while starting I got the error: The application did not respond from discord. If you know how can I fix it I will be very grateful, this is my code:

const commandsHandler = require("../../Handlers/commands-handler");

module.exports = {
    name: "ban",
    description: "Ban a member from the server.",
    permission: "ADMINISTRATOR",
    options: [{
        name: "target",
        type: "USER",
        description: "The target you want to ban.",
        required: true
    },
    {
        name: "reason",
        type: "STRING",
        description: "Reason for ban.",
        required: false,
    }
    ],

    execute(inter, client) {
        run: async(inter, client) => {
            const user = inter.options.getUser("target")
            let BanReason = inter.options.getString("reason")
            const member = inter.guild.members.cache.get(user.id)
            if(!member) return inter.reply("The target doesn't exist in the server.")
            if(!BanReason) BanReason = "No reason provided"

            await inter.guild.members.ban(member, { reason: BanReason })
            inter.reply(`Sucessfully banned ${user.tag}\nreason: ${BanReason}`)
            .catch(() => {
                inter.reply("Cannot ban the member.")
            })
        }
    }
}```
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