mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 21:44:48 +02:00
Permission Check fix in Neopet, new error message.
This commit is contained in:
@@ -15,14 +15,14 @@ class NeopetCommand extends commando.Command {
|
||||
if(message.channel.type !== 'dm') {
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission('SEND_MESSAGES')) return;
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGES')) return;
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return;
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return;
|
||||
}
|
||||
console.log("[Command] " + message.content);
|
||||
let [petID] = message.content.split(" ").slice(1);
|
||||
if(petID === "getID") {
|
||||
message.channel.sendMessage("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!").then(message.channel.sendFile('./images/PetID.png').then(message.channel.sendMessage("It's recommended you keep this ID with you so you can easily share your pet's picture without having to repeat these steps.")));
|
||||
} else {
|
||||
message.channel.sendMessage("Result for: " + petID).then(message.channel.sendFile('http://pets.neopets.com/cp/' + petID + '/1/5.png').catch(error => message.channel.sendMessage(":x: Error! Pet ID Not Found!")));
|
||||
message.channel.sendMessage("Result for: " + petID).then(message.channel.sendFile('http://pets.neopets.com/cp/' + petID + '/1/5.png').catch(error => message.channel.sendMessage(":x: Error! Pet ID Not Found!\n:notepad_spiral: Note: This command is subject to something of a ratelimit. Try again soon if you're sure your ID is valid.")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user