Adding ship command to twitch

Asked Oct 24, 2024ยท2 repliesยทLast activity 1 year 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.

Ok so I've been working on adding a ship command, but have been having SO many issues no matter what I change.

The basic idea is:
!ship
returns:
๐Ÿ’” Aw you have no one to love ;-; don't worry, I'm here for you! ๐Ÿ’”

!ship user1
returns:
๐Ÿ’ž [invoker] &[user1] are [random choice based on compatibility] ๐Ÿ’ž ([random % compatible]%) ๐Ÿ’ž

!ship [user1] [user2]
returns:
๐Ÿ’ž [user1] & [user2] are [random choice based on compatibility] ๐Ÿ’ž ([random % compatible]%) ๐Ÿ’ž

!ship [user1] [user1]
returns:
Try shipping two different people!

I tried:

js
$(eval
u1="$(touser $(1))".toLowerCase();
u2="$(touser $(2))".toLowerCase();
u2 = u2 == "" ? "$(user).toLowerCase()" : u2;
rand=Math.floor(Math.random() * 101);
a=rand==0 ? "arch nemesies" : rand<20 ? "enemies" : rand<30 ? "friends" : rand<65 ? "friends" : rand<75 ? "best friends" : rand<90 ? "lovers" : "soul mates";
(u1=="" && u2=="") ? `๐Ÿ’” Aw you have no one to love ;-; don't worry, I'm here for you! ๐Ÿ’”` :
(u1 == u2 ? `๐Ÿ’– Try shipping two different people... ๐Ÿ’–` :
`๐Ÿ’ž ${u1}, and ${u2} are ${a} ๐Ÿ’ž (${rand}% compatible) ๐Ÿ’ž`)
)

and a few different variations to no avail. The snippet here is to long.

2 replies

Try the following:

$(eval x=`$(1)`;y=`$(2)`;let r;if(x==='null'&&y==='null'){r=`๐Ÿ’” Aw you have no one to love ;-; don't worry, I'm here for you! ๐Ÿ’”`;}if(r==null&&y==='null'){y=x;x=`$(user)`;}if(r==null&&x.toLowerCase()===y.toLowerCase()){r=`๐Ÿ’– Try shipping two different people... ๐Ÿ’–`;}if(r==null){a=Math.floor(Math.random()*101);b=a===0?`arch nemesies`:a<20?`enemies`:a<30?`friends`:a<65?`friends`:a<75?`best friends`:a<90?`lovers`:`soul mates`;r=`๐Ÿ’ž ${x} and ${y} are ${b} ๐Ÿ’ž (${a}% compatible) ๐Ÿ’ž`;}r)

Not sure how to mark this as the answer, but this seems to have done it! Thank you!