2021-01-23 01:08:05 -06:00
|
|
|
module.exports = {
|
2022-04-18 11:25:40 -05:00
|
|
|
|
|
|
|
name: require('path').parse(__filename).name,
|
2022-04-21 18:09:21 -05:00
|
|
|
description: 'Gets bot ping',
|
2022-04-21 20:53:03 -05:00
|
|
|
options: [],
|
2022-04-21 18:09:21 -05:00
|
|
|
|
2022-04-21 23:44:02 -05:00
|
|
|
async parseMessage (client, config, message, args) {
|
2022-04-23 13:07:50 -05:00
|
|
|
await message.channel.send(await this.handle(client, config, message.author));
|
2022-04-21 23:44:02 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
async parseInteraction (client, config, interaction) {
|
2022-04-23 13:07:50 -05:00
|
|
|
await interaction.reply(await this.handle(client, config, interaction.user));
|
2022-04-21 23:44:02 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
async handle (client, config, user) {
|
2022-04-21 18:09:21 -05:00
|
|
|
const index = Math.floor(Math.random() * config.locations.length);
|
|
|
|
const location = config.locations[index];
|
|
|
|
|
2022-04-21 23:44:02 -05:00
|
|
|
return {
|
2022-04-21 18:09:21 -05:00
|
|
|
embeds: [{
|
|
|
|
title: ':ping_pong: Ping',
|
|
|
|
description: `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`,
|
|
|
|
color: 9442302,
|
|
|
|
footer: {
|
2022-04-21 23:44:02 -05:00
|
|
|
icon_url: user.displayAvatarURL(),
|
2022-04-21 18:09:21 -05:00
|
|
|
text: config.footerTxt
|
|
|
|
}
|
|
|
|
}]
|
2022-04-21 23:44:02 -05:00
|
|
|
};
|
2021-01-23 01:08:05 -06:00
|
|
|
}
|
|
|
|
};
|