2020-03-11 10:46:13 +00:00
|
|
|
const request = require('request')
|
|
|
|
exports.run = async (client, message, args) => {
|
2020-03-16 01:14:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
//NOT FINISHED
|
|
|
|
|
|
|
|
if(!args[0] || !args[1]) {
|
|
|
|
return message.channel.send(`<:error:466995152976871434> Please include two users`)
|
|
|
|
}
|
2020-03-11 10:46:13 +00:00
|
|
|
message.channel.startTyping();
|
|
|
|
|
|
|
|
var user = client.getUserFromMention(args[0])
|
|
|
|
var user2 = client.getUserFromMention(args[1])
|
2020-03-16 01:14:33 +00:00
|
|
|
|
|
|
|
if (!user) {
|
|
|
|
let users;
|
|
|
|
users = client.searchForMembers(message.guild, args[0]);
|
|
|
|
if (users.length > 1)
|
|
|
|
return message.channel.send(
|
|
|
|
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
|
|
|
|
);
|
|
|
|
else if (users.length == 0)
|
|
|
|
return message.channel.send(
|
|
|
|
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
|
|
|
|
);
|
|
|
|
user = users[0];
|
|
|
|
};
|
|
|
|
|
|
|
|
if (!user2) {
|
|
|
|
let users;
|
|
|
|
users = client.searchForMembers(message.guild, args[0]);
|
|
|
|
if (users.length > 1)
|
|
|
|
return message.channel.send(
|
|
|
|
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
|
|
|
|
);
|
|
|
|
else if (users.length == 0)
|
|
|
|
return message.channel.send(
|
|
|
|
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
|
|
|
|
);
|
|
|
|
user2 = users[0];
|
|
|
|
};
|
2020-03-11 10:46:13 +00:00
|
|
|
|
|
|
|
var secondLength = Math.floor(user2.username.length / 2);
|
|
|
|
|
2020-03-16 01:14:33 +00:00
|
|
|
var first = user.username.slice(0, user.username.length / 2)
|
|
|
|
var second = user2.username.slice(secondLength, user2.username.length / 2)
|
2020-03-11 10:46:13 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
var attachment = new Discord.MessageAttachment(`https://api.alexflipnote.dev/ship?user=${user.avatarURL({format: "png"})}&user2=${user2.avatarURL({format: "png"})}`)
|
|
|
|
message.channel.send(`Your ship name is **${first+second}!**`, attachment)
|
|
|
|
message.channel.stopTyping();
|
|
|
|
} catch(err) {
|
|
|
|
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
|
|
|
message.channel.stopTyping();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.conf = {
|
|
|
|
enabled: true,
|
2020-03-16 01:14:33 +00:00
|
|
|
guildOnly: true,
|
2020-03-11 10:46:13 +00:00
|
|
|
aliases: [],
|
|
|
|
permLevel: "User",
|
|
|
|
requiredPerms: []
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.help = {
|
|
|
|
name: "ship",
|
|
|
|
category: "Fun",
|
|
|
|
description: "Ship two people together <3",
|
|
|
|
usage: "ship name name2"
|
|
|
|
};
|
|
|
|
|