Replying to a keyword sometimes / at random

Heyyyo! I want to make Nightbot respond sometimes to a specific keyword (emote) and then cooldown

For example, if my chat starts to catJAM, I want Nightbot to join in with a catJAM after a few catJAM in chat … instead of the 1st catJAM that a keyword typically triggers

So I’m thinking it’s a probability thing to kinda randomize it, but I have no idea how to write that. Thank you!

This should work the bot crates a random numer between 0-7 and if the number is less tan 5 it will send the message, change the numbers (7 or 5) for less or more frequency:

$(eval var N=Math.floor((Math.random() * 7) + 1); if(N < 5){"catJAM"}else{" "})

Brilliant!! That’s working perfectly … Thank you so much for taking the time to solve that for me!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.