How to create Nightbot command to !slap streamer ONLY?

Asked Aug 29, 2020·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.

I just found out about the !slap command and want to modify it to slap the streamer ONLY when someone types !slap. Right now if it's anything other than "tosuer" it doesn't work, but touser is pointless.. it will say "WayneTables slapped Waynetables with a cactus"..

Is there a way to point the command to the streamer, Dwight_LOL ?

!addcom !slap $(user) slapped $(touser) with a $(eval a=[stinky fish,television set,cactus];a[Math.floor(Math.random()*a.length)])!

2 replies

You should just be able to replace $(touser) with $(channel) though you could also just write the streamers name in the command.

Hey @Chilly Turtle!

This should do the job:

!addcom !slap $(eval t=`$(query)`?`$(query)`:`Dwight_LOL`;o=[`stinky fish`,`television set`,`cactus`];`$(user) slapped ${t} with a ${o[Math.floor(Math.random()*o.length)]}!`)