Phrase Counter In Chat

Is there a way to make a command that counts every time a set phrase is typed in chat?

Someone: This is an example text

Anyone: !example

Nightbot: The phrase “this is an example text” has been said 1 time(s)

Thanks

Yes the command will only count if it’s exactly word for word right though.
Command:

!addcom first_word_of_phrase -a=!editcom !second_command_name $(eval `$(query)`.toLowerCase()==`rest_of_phrase`.toLowerCase()?`Phrase_here has been said $(count) times.`:` `)

Second Command:

!addcom !second_command_name Phrase_here has been said x times.

omg awesome! This is pretty much what I was looking for.

Is there a way to make it so the nightbot respond isn’t triggered from someone typing the phase but instead if someone does a !example message in chat?

So when someone types “this is an example text” it adds +1 to the count but nightbot doesn’t respond until someone types !example

Thank you so much!

I edited the command above. There is technically a flaw with how the code is run in that it could cause an error but it shouldn’t happen. Let me know if you have any issues and I’ll be happy to fix them.

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