Check if certain user is using the command?

Asked Feb 21, 2021·2 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.

Hi. I’m trying to make a !rate command that rates users out of 10. But I want it to give a rating of 0 every time a specific user I know uses the command. I tried this:

Nightbot gives you a rating of $(eval var a = “$(user)”; if(a == “Username”){0}else{ Math.floor((Math.random() * 10) + 1)})

But it still returns Invalid or Unexpected Token. Is there something I’m doing wrong? Please let me know

2 replies

This should work fine.

Nightbot gives you a rating of $(eval `$(user)`==`USER`?0:Math.ceil(Math.random()*10))
Deft Penguin said:
$(eval $(user)==USER?0:Math.ceil(Math.random()*10))

It worked, thanks for your help.