From 93c3dfa65e09350c80aa02490b177e734d467279 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Wed, 28 Sep 2022 19:05:07 -0400 Subject: [PATCH] Adding an Example ContentMenu Command --- commands/Info/ping.js | 2 +- commands/context/ping.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 commands/context/ping.js diff --git a/commands/Info/ping.js b/commands/Info/ping.js index 1eac0a6..9a6b3d6 100644 --- a/commands/Info/ping.js +++ b/commands/Info/ping.js @@ -2,7 +2,7 @@ const { EmbedBuilder } = require('discord.js'); module.exports = { name: "ping", - private: false, + private: true, description: "Returns websocket latency", run: async (client, interaction) => { diff --git a/commands/context/ping.js b/commands/context/ping.js new file mode 100644 index 0000000..ed946c5 --- /dev/null +++ b/commands/context/ping.js @@ -0,0 +1,16 @@ +const { EmbedBuilder } = require('discord.js'); +const {ApplicationCommandType } = require('discord.js'); + +module.exports = { + name: "ping-test", + type: ApplicationCommandType.Message, + run: async (client, interaction) => { + const embed = new EmbedBuilder() + .setColor("#FF0000") + .setTitle("🏓 Pong!") + .setDescription(`Latency : ${client.ws.ping}ms`) + .setTimestamp() + .setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` }); + interaction.followUp({ embeds: [embed] }); + }, +};