Change how it gets locations from config
This commit is contained in:
parent
e861e702c0
commit
9eb8bd3d35
|
@ -1,19 +1,17 @@
|
||||||
const { locations } = require('../config.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "ping",
|
name: "ping",
|
||||||
description: "Gets bot ping",
|
description: "Gets bot ping",
|
||||||
async execute(client, message, _, footerTxt) {
|
async execute(client, message, args, config) {
|
||||||
const index = Math.floor(Math.random() * locations.length);
|
const index = Math.floor(Math.random() * config.locations.length);
|
||||||
const pingLocation = locations[index]
|
const location = config.locations[index]
|
||||||
|
|
||||||
await message.channel.send({embed:{
|
await message.channel.send({embed:{
|
||||||
"title": ":ping_pong: Ping",
|
"title": ":ping_pong: Ping",
|
||||||
"description": `**Pong!** We pinged **${pingLocation}** and got ${client.ws.ping} ms.`,
|
"description": `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`,
|
||||||
"color": 9442302,
|
"color": 9442302,
|
||||||
"footer": {
|
"footer": {
|
||||||
"icon_url": message.author.displayAvatarURL(),
|
"icon_url": message.author.displayAvatarURL(),
|
||||||
"text": footerTxt
|
"text": config.footerTxt
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue