bot.on('message', message => {
var str = (message.content.indexOf("swear"))
if (str != -1){
var Pottymouth = message.guild.roles.find('name', 'Pottymouth')
message.channel.send("Woah there, " + message.author + ", you can't use that kind of language here!");
message.member.addRole(Pottymouth);
}
I'm trying to code Jesus as a super cool bot, and one thing he needs to do is make sure that nobody's swearing. So far, this code works for when someone says "swear", but it won't detect them saying "SWEAR" or any other capitalisation. How do I make Jesus not bother with listening to case, and instead focus on the actual content of the message?