Word Counter For Chat

Asked Aug 31, 2021·4 replies·Last activity 4 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hello! I was trying to make a command that can track how many times a word has been said. Such as "jack" which is my name, and then everytime that get's said in a sentence or chat, it adds to a counter that I can do like !jack and have a count for the number of times it's been chatted. Anything helps!

4 replies

@Silky Tiger No real way of doing this. As a command Nightbot only sees the first argument.

!addcom -cd=5 jack $(eval temp=$(count); ` `)

This will secretly count the command. And later you can check how many times the command is being called. Note the counter only increase if someone types the first word as "jack".

Regards

I'm assuming that the word you want counted goes inside the ' '?

Hey @Silky Tiger!

No, here the `` ` is for the counter to count silently, otherwise it'll just send numbers in your chat every time someone says your name as the first word of their message, jack`—as the command—is what is counted, and as @Maple Goose said, you can't count words that aren't the first one of a message.

I figured that out the hard way lol. I ended up doing an Alias and called on a command that says the number everytime. But thanks for the help! Still helped me with understanding Nightbot better!