woomy/commands/ship.js

70 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-04-06 16:35:06 +00:00
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 'User',
2020-04-11 09:30:51 +00:00
requiredPerms: [],
cooldown: 2000
2020-04-06 16:35:06 +00:00
}
exports.help = {
name: 'ship',
category: 'Fun',
description: 'Ship two people together <3',
2020-04-11 09:30:51 +00:00
usage: 'ship `[name1]` `[name2]`',
parameters: '`name1` The name of the first person you want to ship.\n `name` The name of the second person you want to ship.'
2020-04-06 16:35:06 +00:00
}
2020-04-08 08:12:01 +00:00
const { MessageEmbed } = require('discord.js')
2020-04-06 16:35:06 +00:00
exports.run = async (client, message, args, level, data) => {
var rating = Math.floor(Math.random() * 100) + 1
2020-04-08 08:12:01 +00:00
var meter = ['▬', '▬', '▬', '▬', '▬', '▬', '▬', '▬', '▬']
2020-04-06 16:35:06 +00:00
var hearts = [
'❤️',
'🧡',
'💛',
'💚',
'💙',
'💜'
]
2020-04-11 09:30:51 +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-04-06 16:35:06 +00:00
}
2020-04-07 08:10:01 +00:00
const firstName = args[0]
const secondName = args[1]
2020-04-06 16:35:06 +00:00
const shipName = firstName.substr(0, firstName.length * 0.5) + secondName.substr(secondName.length * 0.5)
if (shipName.toLowerCase() === 'teily' || shipName.toLowerCase() === 'emrra') {
rating = '100'
}
2020-04-08 08:12:01 +00:00
var pos = 0
var under = 9
while (pos < 10) {
if (rating < under) {
meter.splice(pos, 0, hearts.random())
break
}
pos++
under += 10
}
if (rating > 99) {
meter.splice(9, 0, hearts.random())
}
const embed = new 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-04-06 16:35:06 +00:00
}