fix ship command

This commit is contained in:
FLGX 2020-03-19 11:46:10 +01:00
parent 0360a5c581
commit 4948a5d1f5
No known key found for this signature in database
GPG key ID: 999D16475015DDE3

View file

@ -23,12 +23,12 @@ exports.run = async (client, message, args) => {
return message.channel.send( return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!" "<:error:466995152976871434> That user doesn't seem to exist. Try again!"
); );
user = users[0]; user = users[0].user;
}; };
if (!user2) { if (!user2) {
let users; let users;
users = client.searchForMembers(message.guild, args[0]); users = client.searchForMembers(message.guild, args[1]);
if (users.length > 1) if (users.length > 1)
return message.channel.send( return message.channel.send(
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
@ -37,13 +37,13 @@ exports.run = async (client, message, args) => {
return message.channel.send( return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!" "<:error:466995152976871434> That user doesn't seem to exist. Try again!"
); );
user2 = users[0]; user2 = users[0].user;
}; };
var secondLength = Math.floor(user2.username.length / 2); var secondLength = Math.floor(user2.username.length / 2);
var first = user.username.slice(0, user.username.length / 2) var first = user.username.slice(0, secondLength - 1)
var second = user2.username.slice(secondLength, user2.username.length / 2) var second = user2.username.slice(secondLength)
try { try {
var attachment = new Discord.MessageAttachment(`https://api.alexflipnote.dev/ship?user=${user.avatarURL({format: "png"})}&user2=${user2.avatarURL({format: "png"})}`) var attachment = new Discord.MessageAttachment(`https://api.alexflipnote.dev/ship?user=${user.avatarURL({format: "png"})}&user2=${user2.avatarURL({format: "png"})}`)