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

180
Vistas
Discord.JS token ban function not working properly when trying to run the command in terminal

Ok so i was trying to create a discord bot, with ban commands but then this happened

https://i.stack.imgur.com/ogAHf.png

Here is my code

https://i.stack.imgur.com/5ceGo.png

How do i fix this?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

It should be:

module.exports = {
    name: 'ban',
    description: "This command bans people",
    execute(message, args) {

        if(message.member.roles.cache.has('923203237019004958')) {
            const member = message.mentions.members.first();
            if(member) {
                const memberTarger = message.guild.members.cache.get(member.id);
                memberTarger.ban();
                message.channel.send("User has been banned from the paper bag");
            }
            else {
                message.channel.send("You don't have the sufficent permissions to run this command")
            }
        }

    }
}

There was a closing bracket } next to the execute(message, args) but it should be an opening bracket {

about 4 years ago · Santiago Trujillo 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