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

200
Views
discord.js - Characters do not appear or do not work

Everyone, I built a hello bot and the system works but perfectly there is a small problem, I want the system to display only after typing '$' + the name that is in the database, will display the database.

Code:

 var name = (message.content);
            var sql = `SELECT * FROM customers WHERE name = ?`;
            con.query(sql, [name], function(err, result) {
                if (err) throw err;

                if (message.content.startsWith(prefix + result[0].name)) {
}

Now, as soon as I print a particular variable it does nothing, but if I type in the database the full name $Example It invented for me if I used the same code but without prefix + in the startsWith call.

How do I make a bot work even if the special character is not listed in the database?

about 4 years ago · Juan Pablo Isaza
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!