Custom death counter

I’m not the one who came up with the idea of a death counter. I’ve researched the forum and didn’t find the things I need, only basics. It’s not a secret, that it’s not hard to do that, So far I have !death+, !deaths, !resetdeaths.
!commands add !death+ -ul=moderator -a=!commands edit !deaths Deaths so far: $(count).
!commands add !deaths Deaths so far: 0.
!commands add !resetdeaths-a=!commands edit !death+ -c=0

The thing is that I actually want tham to display a custom text saying “Death added [totalnumber]” and “deaths are reset” instead of long and completely unnecessary “the command “!commandname” has been edited successfully.”. (or just make nightbot reply nothing)
And the other thing is that I’d like !resetdeaths to do 2 things at once: clear the counter and clear the death number displayed in !deaths. So how do I do that?

It’s not possible to do that (change the edited text, modify multiple commands) with how nightbot’s command system works. A customapi would be needed

Go to You will see three lines. After token= on the first line, you will see your first token. After token= on the second and third lines, you will see your second token. Use these to replace FIRSTTOKEN and SECONDTOKEN before you add the following commands.


$(eval quotes = `$(urlfetch json`; deaths = quotes == "There are no quotes added" ? 0 : quotes.length; `Deaths so far: ${deaths}`)


$(eval match = `$(urlfetch json`.match(/^Successfully added entry #(\d+)$/); match ? `Death added: ${match[1]} total death${match[1] == 1 ? "" : "s"}` : "Failed to reach API")


$(eval `$(urlfetch` == "There are no quotes added" ? "There are already 0 deaths" : (`$(urlfetch`, "Deaths have been reset"))

You might have to call !resetdeath right after you add the commands, because some bot was automatically clicking the link in the !death+ command when I was adding it, causing the number to start off at 2.


Are you a Jesus or something? Thank you so much!

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