mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 05:54:33 +02:00
Better Validators and More Destucturing
This commit is contained in:
@@ -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!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user