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

300
Vistas
How do I make me bypass permission restrictions

I have a command and I want to make one of my commands to bypass the locked permissions..

How do I make the code bypass the permission restrictions with my id?

Code:

    if (!message.guild.me.hasPermission('BAN_MEMBERS')) return message.reply('I don\'t have permission to ban members!', { allowedMentions: { repliedUser: false } });
    if (!message.member.hasPermission('BAN_MEMBERS')) return message.reply('You don\'t have permission to ban members!', { allowedMentions: { repliedUser: false } });
    if (!args[0]) return message.reply('Provide someone to ban!', { allowedMentions: { repliedUser: false } });
    let check = false;
    const target = message.mentions.members.first() || await message.guild.members.fetch(args[0]).catch(e => {
        check = true;
        return message.reply('Can\'t find specefied member! Provide a valid id', { allowedMentions: { repliedUser: false } });
    });
    if (check) return;
    if(target.id === message.author.id) return message.reply('Why would you want to ban yourself?!', { allowedMentions: { repliedUser: false } });
    if(target.id === client.user.id) return message.reply('Why would you want to ban me?!', { allowedMentions: { repliedUser: false } });
    let reason = "No reason provided.";
    if (args[1]) reason = args.splice(1).join(" ");
    if (!target.bannable) return message.reply('Can\'t ban specified member! Make sure I\'m above them in the heirarchy', { allowedMentions: { repliedUser: false } });

            await target.ban({ reason: reason });
            const banEmbed = new MessageEmbed()
                 .setColor("#ff0000")
                                 .setFooter(message.guild.name, message.guild.iconURL())
                                 .addField("**Moderation**", "Ban")
                                 .addField("**Name**", `${target.user.tag}`)
                                 .addField("**Banned By**", message.author.username)
                                 .addField("**Reason**", `${reason || "**No Reason**"}`)
                                 .addField("**Date**", message.createdAt.toLocaleString())
                                 .setTimestamp();
            message.channel.send(banEmbed)
        }
    
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Your second line, the one that checks for the user's permissions is what you must update. Inside of the condition, also make sure that the user's id is not yours. Something like this

if(!message.member.hasPermission('BAN_MEMBERS') && message.author.id != "09128029381") return message.reply("no");
over 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