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

72
Views
Bot triggers itself with a command

While I was coding a command for my bot:

client.on('message', message=> {
    if (message.content.valueOf('ip'))
        message.channel.send(
            "Our Server IP is `blank` For Java. For Bedrock it is `blank` and port `blank`."
        )
});

The bot would auto reply to itself. Is there any piece of code I can add to make it not do this?

Fixed: replaced .valueOf to .includes

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The code if (message.author.id === client.user.id) return; checks if the message's author is the same as client's user (your bot) and skips the 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!