0
votes

I made a discord bot that reads a specific channel and checks if the users are typing in a specific sintax. If the user doesn’t type using the proper syntax the bot is supposed to delete the message.

Here is the code: enter image description here

The bot is not supposed to delete messages that start with the prefixes “!,- and ~” or messages from bots.

The bot successfully deletes the improper messages but also deletes the proper messages. How can I fix this?

1

1 Answers

2
votes

Replace your || with &&. It should be

if (!content.startsWith("!") && !content.startsWith("-") && !content.startsWith("~")) { ... }