Adding an optional value for a command

Asked Feb 8, 2024·1 reply·Last activity 2 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've this command:
$(sender) lick $(touser) $(2) $(random.1-100) times LICKA
It works only if also second value (2) is given. Is there a way to transform $(2) as an optional value?

1 reply

this command looks like it's written for streamelements, the code i'm about to give u will only work in nightbot... but here it is...

js
$(user) licks $(touser)$(eval let a=`$(2)`,b=Math.floor(Math.random()*100)+1;`${a!=`null`&&a!=``&&a!=` `?`'s ${a}`:``} ${b} time${b==1?``:`s`}`) LICKA