Added Slash Command - Ping

imgbot
KieranRobson 2022-06-27 11:00:24 +01:00
parent a5b1c05195
commit 304b23523c
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js");
module.exports = {
name: "ping",
description: "returns ping of the Hullcss bot",
type: 'CHAT_INPUT',
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args) => {
let days = Math.floor(client.uptime / 86400000);
let hours = Math.floor(client.uptime / 3600000) % 24;
let minutes = Math.floor(client.uptime / 60000) % 60;
let seconds = Math.floor(client.uptime / 1000) % 60;
const embed = new MessageEmbed()
.setColor('GREEN')
.setFooter(`Called By: ${interaction.user.tag}`)
.setTimestamp()
.setTitle("Pong!")
.setDescription(`${client.ws.ping} ping to host`)
.addField('Uptime', ` ${days}days ${hours}hrs ${minutes}min ${seconds}sec`, true)
interaction.followUp({ embeds: [embed]});
},
};