• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

160
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 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error