Target either 2 random user or targert 2 specific user

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
!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

$(user) ships $(urlfetch$(channel)) and $(urlfetch$(channel)) aren’t they cute together?

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

Hey @Kyra!

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$(channel))`; u[u.length]=`$(urlfetch$(channel))`;} `$(user) ships ${u[0]} and ${u[1]}, aren't they cute together?`)

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

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.