New to Nightbot, is this just counting?

Asked Oct 18, 2021·1 reply·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.

Why won't it print the text outside of eval and why won't it execute the if statement? It just keeps counting... Sorry I am new. Thanks for any help!

!commands add !test21 You have $(eval -a=!test22 $(query);if((-a=!test22 $(query))>4){-a=!commands edit !test22 \-c=0;}) hours left
!commands add !test22 $(count)

1 reply

You can only set one alias to a command ther eval isn’t even actually reading the -a also you don’t have qoutes around the text you want output.
This should work for what I presume you want:

!addcom !test21 -a=!editcom !test22 \-c=$(eval Number.parseInt($(1))>4?`0`:`$(1)`)