Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
discord.js v13: how to make a role with the highest available position

I want to do a mute command where the bot creates a role and puts it in the highest position it can.

Here's my code:

run: async (client, message, args) => {
    if (!message.guild.me.permissions.has("MANAGE_ROLES")) return message.channel.send("Eu não tenho perm: `MANAGE_ROLES`");

    let rolecreate = message.guild.roles.create({ name: "", permissions: [], reason: "" }).then((create) => message.member.roles.add(create));
};
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

You can create a role as high as the bot's highest role, because after the role is created, the bot's highest role shifts up, and you cannot create a role higher than your own highest role. You can set this with the position option:

let rolecreate = message.guild.roles.create({ 
  name: "", 
  permissions: [], 
  reason: "", 
  position: msg.guild.me.roles.highest.position 
})
.then(/*... */);
about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda