Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!