I made a discord bot called YES, and I have a text channel for images only, and I am trying to make it that if there is a text message the bot will delete it and reply "You cannot send text messages". I also made a whitelist for the bot because I want him to be able to send text messages.
client.on("message", async message => {
var usernames = ["YES"]
if (usernames.includes(message.author.username)) {
if (message.attachments.size > 0) {
message.delete();
client.channels.cache.get("841260660960395287").send(message.author.username + ", you cannot send text")
}
}
})
This doesn't work at all and it doesn't show any errors.