mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Finished implementing the 'msearch' command
This commit is contained in:
@@ -15,12 +15,38 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
let cmd = args[args.length - 1];
|
||||
search.search(type, {
|
||||
maxResults: 1,
|
||||
term: name
|
||||
}).then((data) => {
|
||||
console.log(data[0]);
|
||||
message.reply("This command has not been implemented yet!");
|
||||
}).then((data1) => {
|
||||
let data = data1[0];
|
||||
if (cmd == "~stats") {
|
||||
const newEmbed = new Discord.MessageEmbed()
|
||||
.setColor('#ff9900')
|
||||
.setTitle(data.title)
|
||||
.setURL(data.url)
|
||||
.setImage(data.thumbnail)
|
||||
//.setDescription('My professional resume')
|
||||
.addFields(
|
||||
{name: 'Type:', value: data.type},
|
||||
{name: 'Score:', value: data.score},
|
||||
{name: 'Volumes:', value: data.vols}
|
||||
);
|
||||
|
||||
message.channel.send({ embeds: [newEmbed] });
|
||||
} else if (cmd == "~fancy") {
|
||||
let temp = `The ${data.type} _${data.title}_ currently has ${data.vols} volumes with ${data.nbChapters} chapters, `;
|
||||
temp += `running from _${data.startDate.replace(/-/g, "/")}_ to _${data.endDate.replace(/-/g, "/")}_, and has a score of ${data.score} on MyAnimeList!\n`;
|
||||
temp += `You can read more about _${data.title}_ at ${data.url}`;
|
||||
|
||||
message.channel.send(temp);
|
||||
} else if (cmd == "~summary") {
|
||||
//Remove the "read more." at the end
|
||||
let temp = data.shortDescription.slice(0, -10);
|
||||
temp += ` _read more at_ ${data.url}`;
|
||||
return message.channel.send(temp);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user