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

134
Vistas
How can I put 2 discord ids inside a if(message.author.id !=) statement

Hello ive been trying to run this code and tried recoding it multiple times but when ever I try to put 2 ids inside of the if(message.author.id != ownerid) return message.channel.send("You don't have access to this command"); it only registers 1 of the ids heres my current code:

client.on('message', message => {
    if (message.content === prefix + 'listservers') {
    if(message.author.id != ownerid && altid) return message.channel.send("You don't have access to this command");
//rest of the code

}})
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You've got a few different options. Here's how I'd do it, using an array and Array.includes():

const allowedUsers = ["user id 1", "user id 2"]

client.on('message', message => {
    if (message.content === prefix + 'listservers') {
    if(!allowedUsers.includes(message.author.id)) return message.channel.send("You don't have access to this command");
//rest of the code

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