Help with Nightbot Command

I’m trying to make a command which is a dad joke.
So if someone types “I am going to scream” into chat, nightbot would respond “Hi going to scream! I’m Nightbot!”
!addcom i $(eval $(query).toLowerCase().includes(“am”) ? “Hi $(query)! I’m Nightbot” : " ")
is my command and it works but $(query) also returns “am” as part of the reply so it looks like “Hi am going to scream! I’m Nightbot!”

is there a way to not include the word “am” in there? i know $(query) returns the entire sentence but i can’t think of anything else that would work. TY in advance

This should do what you want:

!addcom i $(eval a="$(query)".slice(3);"$(1)".toLowerCase()=="am"?"Hello "+a+"! I’m Nightbot.":" ")

thank you so much!!!

So, I thought this was a really awesome idea but I’d like to change it up a bit. I’m trying to figure out how to get it to recognize “i’m” as a trigger rather than “i am” but I can’t seem to get it to work even with escaping the character.

Hey @tylahtrash!

Simply create a command with the name I'm:

!addcom i'm $(eval `$(query)`?`Hello $(query)! I’m Nightbot.`:` `)

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