mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Change in Neopet
This commit is contained in:
@@ -10,30 +10,18 @@ module.exports = class NeopetCommand extends commando.Command {
|
||||
examples: [';neopet rjwlsb8k', ';neopet getID'],
|
||||
args: [{
|
||||
key: 'pet',
|
||||
prompt: 'What pet ID would you like to get the image of? Use `getID` for info.',
|
||||
prompt: 'What pet ID would you like to get the image of?',
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let petID = encodeURI(args.pet);
|
||||
if (petID === "getID") {
|
||||
let petIDMsg = await message.say("To get your pet's ID, simply go to http://www.sunnyneo.com/petimagefinder.php and enter your pet's name. It's image should show up. Then, find the link below the pet's image, and copy it to your message! It's recommended you keep this ID with you so you can easily share your pet's picture without having to repeat these steps.");
|
||||
let petImg = await message.channel.sendFile('./images/PetID.png');
|
||||
return [petIDMsg, petImg];
|
||||
}
|
||||
try {
|
||||
let petMsg = await message.say(`Result for: ${petID}`);
|
||||
let petImg = await message.channel.sendFile(`http://pets.neopets.com/cp/${petID}/1/5.png`);
|
||||
return [petMsg, petImg];
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(":x: Error! Pet ID Not Found! Use `;neopet getID` for help on getting your pet ID.");
|
||||
}
|
||||
let petID = args.pet;
|
||||
return message.say(`http://pets.neopets.com/cp/${petID}/1/5.png`);
|
||||
}
|
||||
};
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
Reference in New Issue
Block a user