Better Validators and More Destucturing

This commit is contained in:
Daniel Odendahl Jr
2017-04-19 18:55:26 +00:00
parent c064401b37
commit d77f71b66a
40 changed files with 114 additions and 124 deletions
+2 -2
View File
@@ -40,9 +40,9 @@ module.exports = class MapCommand extends Command {
}
const { zoom, location } = args;
try {
const response = await request
const { body } = await request
.get(`https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=500x500&key=${process.env.GOOGLE_KEY}`);
return message.channel.send({file: {attachment: response.body}});
return message.channel.send({file: {attachment: body}});
} catch (err) {
return message.say(':x: Error! Something went wrong! Make sure you entered the location correctly!');
}