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

288
Views
(Discord Bot) I was wondering how I could make the code process all of the messages as lower case

i wanted to make it process every message as lowercase so that it would respond if someone said
Tim Nagle, Tim nagle, tim Nagle, etc.

client.on('message', (message) => {
    if(message.content.includes('tim nagle')) {
        message.reply('hello');
}});
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You could overwrite the current messages being sent:

client.on('message', (message)=>{
  message.content = message.content?.toLowerCase();
})

Now all the message contents will be lowercased. The question mark checks if there is a message, therefore will avoid errors where you are trying to lowercase undefined.

about 4 years ago · Juan Pablo Isaza Report

0

The problem I had was where to place toLowerCase() I had also forgotten the parenthesis at the end

client.on('message', (message) => {
    if(message.content.toLowerCase().includes('tim nagle')) {
        message.reply('I want this twink ***OBLITERATED***');
}});
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!