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

331
Vistas
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 Respuestas
Responde la pregunta

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 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