Counter not resetting

Asked Jun 26, 2021·3 replies·Last activity 5 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.

Ive added in these commands;

!commands add !deaths 0

!commands add !died -a=!commands -ul=mod edit !deaths $(channel) has died $(count) times.

!commands add !cleardeaths -a=!commands edit !deaths \-c=0

Im able to add onto the counter but it wont clear it with the clear command, im not sure what im doing wrong exactly ive tried -c=0 which makes the response just "Nightbot: -c=0" as well as \-c=0 which doesnt change the counter at all

3 replies

The !dealths command doesn't use the $(counter) variable and thus there is nothing to reset. If you need an example of how this command would work please see this thread:

(link expired)

I tried using the commands exactly as was posted in that thread but it still wouldnt reset the count

also in my original post, doesnt my !deaths command use the $(count) when i add in the !commands add !died -a=!commands -ul=mod edit !deaths $(channel) has died $(count) times. since that is editing the command? if im looking at it right its basically the same thing youre using in the thread yours posting mines just different wording

when i went into Nightbot commands i saw that the \ in front of \-c=0 wasnt there and thought that might be the issue but even after adding it in manually it still doesnt reset the count

The only command that uses and increments $(count) in this case is your !died command. This is due to variables getting resolved before an alias happens. So when you run the !died command

!commands edit !deaths $(channel) has died $(count) times.

gets converted to

!commands edit !deaths MyCoolChannel has died 5 times.

and then executes to set the static command to edit the !deaths command. This is why !deaths doesn't increment on being used, as it's all static text.

You can view this in action in the dashboard where you can view the current count for the !died command. In my case the !count command.

To reset just use \-c=0 to edit the !died command.

image.png