Files
xiao/commands/search/neopet.js
T
Daniel Odendahl Jr bcaa91c367 Destructuring is Nice
2017-04-11 03:51:10 +00:00

27 lines
893 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class NeopetCommand extends Command {
constructor(client) {
super(client, {
name: 'neopet',
group: 'search',
memberName: 'neopet',
description: 'Gives a Neopet\'s image, searchable by ID. (;neopet rjwlsb8k)',
examples: [';neopet rjwlsb8k'],
args: [{
key: 'pet',
prompt: 'What pet ID would you like to get the image of?',
type: 'string'
}]
});
}
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
const petID = args.pet;
return message.say(`http://pets.neopets.com/cp/${petID}/1/5.png`);
}
};