Target either 2 random user or targert 2 specific user

Asked Jan 18, 2022·2 replies·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.

Hi, im trying to make a command that lets you either target 2 separate users or target 2 randomised user.
For example:
i want the command !ship
to say $(user) ships randomuser1 and randomuser2
or
!ship userA userB
$(user) ships userA and userB

i know how that i can make them in to separate commands but i don't know how to combine them.

For the random one i have

and for the targeted one i have

$(user) ships $(touser) and $(2) aren't they cute

So if anyone has and idea or knows how to combine those two into one command i would be very thankful!
i hope you all are having a great day

2 replies

Hey @Hardy Narwhal!

You need to use $(eval) and JavaScript to merge the two together, like this:

$(eval u=[]; if(`$(query)`){u=`$(query)`.split(` `);} if(u.length<2){u[u.length]=`$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))`; u[u.length]=`$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))`;} `$(user) ships ${u[0]} and ${u[1]}, aren't they cute together?`)

Omg Thank you Emily! That works perfectly thank you so much!!