NIGHTBOT Commands with multiple outcomes

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

I want a command that choose especific user , but when you type only the command calls a random user in the chat. I have something like this

!kiss

$(user) has sent a kiss to $(touser), or $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))

I dont really know how to make it an optional answer

1 reply

Hiya, you would need something like this:

js
$(user) has sent a kiss to $(eval '$(touser)' == '$(user)' ? '$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))' : '$(touser)')