woomy/src/commands/ship.js

68 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-04-30 04:11:02 +00:00
const Discord = require('discord.js')
2020-03-11 10:46:13 +00:00
exports.run = async (client, message, args) => {
2020-04-30 04:11:02 +00:00
var rating = Math.floor(Math.random() * 100) + 1
var meter = ['▬', '▬', '▬', '▬', '▬', '▬', '▬', '▬', '▬']
2020-03-22 11:13:41 +00:00
var hearts = [
2020-04-30 04:11:02 +00:00
'❤️',
'🧡',
'💛',
'💚',
'💙',
'💜'
]
if (!args[0]) {
return message.channel.send(client.userError(exports, 'Missing argument, the `name1` argument is required!'))
}
if (!args[1]) {
return message.channel.send(client.userError(exports, 'Missing argument, the `name2` argument is required!'))
2020-03-16 01:14:33 +00:00
}
2020-03-11 10:46:13 +00:00
2020-04-30 04:11:02 +00:00
const firstName = args[0]
const secondName = args[1]
2020-03-21 09:46:51 +00:00
2020-04-30 04:11:02 +00:00
const shipName = firstName.substr(0, firstName.length * 0.5) + secondName.substr(secondName.length * 0.5)
2020-03-21 09:46:51 +00:00
2020-04-30 04:11:02 +00:00
if (shipName.toLowerCase() === 'teily' || shipName.toLowerCase() === 'emrra') {
rating = '100'
}
2020-03-16 01:14:33 +00:00
2020-04-30 04:11:02 +00:00
var pos = 0
var under = 9
while (pos < 10) {
if (rating < under) {
meter.splice(pos, 0, hearts.random())
break
}
pos++
under += 10
}
2020-03-11 10:46:13 +00:00
2020-04-30 04:11:02 +00:00
if (rating >= 99) {
meter.splice(9, 0, hearts.random())
}
2020-03-11 10:46:13 +00:00
2020-04-30 04:11:02 +00:00
const embed = new Discord.MessageEmbed()
embed.setTitle(`Original Names: ${firstName}, ${secondName}`)
embed.setColor(client.embedColour(message.guild))
embed.setDescription(`Ship Name: **${shipName}**\nCompatibility: **${rating}%**\n**[**${meter.join('')}**]**`)
message.channel.send(embed)
}
2020-03-11 10:46:13 +00:00
exports.conf = {
enabled: true,
2020-03-22 13:01:54 +00:00
guildOnly: false,
2020-03-11 10:46:13 +00:00
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "ship",
category: "Fun",
description: "Ship two people together <3",
2020-04-30 04:11:02 +00:00
usage: "ship [name1] [name2]"
2020-03-11 10:46:13 +00:00
};