How do I make my bot ignore users that I've added to a list? I'm new to this. I tried a few other ways I found on this site but I don't know how to add them to my code, I tried and failed.
Try this:
let blacklistUser = ['UserID1','UserID2']
if(!blacklistUser.includes(user.id)){
///your code
}
Here is a short explanation of the code:
let blacklistUser = ['UserID1','UserID2'] This is an array with the IDs of the blacklisted Users
if(!blacklistUser.includes(user.id)){}
The ! means "NOT" and blacklistUser.includes(user.id) is a funcion that checks if an array(blacklistUser) includes an object(user.id)
You should replace user.id with the needed variable.
For example in a message event it would be: message.author.id.
I hope I could help you, to fix this problem.