i'm a newbie in this whole coding thing. i started working on my first discord bot a couple of days ago, you know, for me and my friends to mess around with. now, let's say that i want this bot to detect words in a message and reply every time someone mentions that word, no matter in which part of the message. i was able to do this, but now there's a problem. let's say that the word I'm looking for is "hello". if someone says "oh hello", "hello there", a message with the word hello, the bot will reply "hello" back. but the bot will also detect the hello in its own message and reply to itself over and over until i shut it down. here's the code:
bot.on("message", message => {
const hello = ["hello"];
if( hello.some(word => message.content.includes(word)) ) {
message.channel.send("Hello!");
}} )
so, i can't figure out how to make the bot not see that "hello" in its own message, or any bot's message if that's easier, but be able to analyze the "hello" from a user, so that it isn't stuck in an infinite loop of replying to itself. how can i do this?? thank you in advance (: