Browse Source

Attempt to add ping command

master
Abheek Dhawan 4 years ago
parent
commit
bd82b23f1d
  1. 12
      index.js

12
index.js

@ -59,6 +59,8 @@ client.on("message", async message => {
case `${prefix}kulboard`: case `${prefix}kulboard`:
kulboardCreate(message) kulboardCreate(message)
break; break;
case `${prefix}ping`:
ping(message);
} }
if (message.content.toLowerCase().startsWith(`${prefix}bulkdelete`)) { if (message.content.toLowerCase().startsWith(`${prefix}bulkdelete`)) {
@ -78,6 +80,16 @@ client.on("message", async message => {
} }
}); });
async function ping(message) {
const pingEmbed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.avatarURL())
.setTitle("Pong!")
.addField(`🏓`, `${Date.now() - message.createdTimestamp}ms`)
.addField(`API`, `${Math.round(client.ws.ping)}ms`)
.setColor("00c5ff")
.setTimestamp();
}
async function startLogs(message) { async function startLogs(message) {
if (!message.member.hasPermission("ADMINISTRATOR")) { if (!message.member.hasPermission("ADMINISTRATOR")) {
message.reply("you do not have admin permissions!"); message.reply("you do not have admin permissions!");

Loading…
Cancel
Save