goat
command
ship
2 jon er love % check koro
0
views
0
likes
0
installs
Aliases: ship, couple
raw source
module.exports = {
config: {
name: "ship",
aliases: ["ship", "couple"],
version: "v1.0",
author: "Sazzad",
countDown: 5,
role: 0,
shortDescription: "2 jon er love % check koro",
longDescription: "2 jon ke mention diye ship koro",
category: "fun",
guide: {
en: "{p}ship @user1 @user2"
}
},
onStart: async function ({ api, event, args, message, usersData }) {
const sendMsg = (txt) => message && typeof message.reply === "function"? message.reply(txt) : api.sendMessage(txt, event.threadID, event.messageID);
let mentions = Object.keys(event.mentions || {});
let targetID1, targetID2;
let name1, name2;
if (mentions.length >= 2) {
targetID1 = mentions[0];
targetID2 = mentions[1];
} else if (mentions.length === 1 && event.type === "message_reply") {
targetID1 = mentions[0];
targetID2 = event.messageReply.senderID;
} else {
return sendMsg("2 jon ke mention de ba 1 jon ke mention + 1 jon ke reply de ๐\nEx: #ship @user1 @user2");
}
name1 = await usersData.getName(targetID1);
name2 = await usersData.getName(targetID2);
// Random % but same pair always same result
const seed = targetID1 + targetID2;
let hash = 0;
for (let i = 0; i < seed.length; i++) {
hash = seed.charCodeAt(i) + ((hash << 5) - hash);
}
const percent = Math.abs(hash % 100) + 1;
const coupleName = name1.slice(0, Math.ceil(name1.length/2)) + name2.slice(Math.floor(name2.length/2));
let status = "";
if (percent < 20) status = "๐ Dure thako vai bon";
else if (percent < 40) status = "๐
ektu crush crush vab";
else if (percent < 60) status = "๐ณ valoi manabe re";
else if (percent < 80) status = "๐ฅฐ perfect couple";
else status = "๐ biye kore felo bhai";
const loveBars = "โค๏ธ".repeat(Math.floor(percent/10)) + "๐ค".repeat(10 - Math.floor(percent/10));
return sendMsg(
`@${name1} x @${name2}
๐ Love Meter: ${percent}%
${loveBars}
Couple Name: ${coupleName}
${status}`
);
}
};