Files
discordeno/template/nodejs/Plugins/General/commands/ping.js
meister03 405e4a7533 Discordeno.js guide (#2313)
* Update Template and Add Discordeno.js notes in favour of depreciating Discord Structures

* Add package.json

* deno fmt

Co-authored-by: meister03 <meisterpi@gmail.com>
Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>
Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2022-08-23 10:31:14 -04:00

25 lines
771 B
JavaScript

const BaseCommand = require("../../../Structures/BaseCommand.js");
const Discord = require("discordeno.js");
class pingcommand extends BaseCommand {
static name = "ping";
static description = "See if the bot latency is okay";
static usage = "";
static category = "General";
static slash = { name: "ping", category: "info" };
constructor(data) {
super(data);
}
async execute() {
const msg = await this.reply({ content: `Pinging...` });
//Assign properties to the response
const ping = msg.timestamp - this.message.timestamp;
const embed = new Discord.Embed()
.setTitle(`The Bots ping is ${ping} ms`)
.toJSON();
//Edit Message with the Embed
return msg.edit({ embeds: [embed] });
}
}
module.exports = pingcommand;