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

332
Visualizações
Adding permissions for roles on discord js

Hey all found this script for users posting invite links... Let's say I wanted to whitelist certain channels from not allowing the bot to ban or kick users posting invite links. Hopefully that makes sense. Thanks.

adminClient.on("message", async message => {
  if (!message.member) return;
  const linkRegex = /(https?:\/\/)?(www\.)?(discord\.(gg|io|me|li|com)(\/invite)?)\/.+[a-z0-9A-Z]/
  if (message.content.startsWith("?ban") && message.member.hasPermission("ADMINISTRATOR")) {
    const mentionedMember = message.mentions.members.first();
    if (!mentionedMember) return message.channel.send("You must mention who you want to ban.")
    mentionedMember.ban().catch(e => message.channel.send(`Something went wrong when banning that user.\n\`${e}\``))
  } else if (message.content.startsWith("?kick") && message.member.hasPermission("ADMINISTRATOR")) {
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You just need to know the channel ID of the channel that u want to whitelist and add a condition on top of that, this way:

if (message.channel.id==WHITELIST_CHANNEL_ID) return;
about 4 years ago · Juan Pablo Isaza 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