Skip to content

Commit

Permalink
[New] Added help to show all available commands!
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Sep 1, 2021
1 parent 71619f8 commit 923e6d9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
29 changes: 29 additions & 0 deletions commands/misc/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { SlashCommandBuilder } = require("@discordjs/builders");

module.exports = {
data: new SlashCommandBuilder()
.setName("help")
.setDescription("Shows all available commands for this bot!"),
async execute(interaction, client) {
await interaction.deferReply();
const commands = client.commands.map(
(command) => `**${command.data.name}** - ${command.data.description}`
);
const embed = {
color: "#9dcc37",
title: `${client.user.username}'s Commands!`,
description: `${commands.join("\n")}`,
author: {
name: `${interaction.user.username}`,
icon_url: `${interaction.user.avatarURL()}`,
},
timestamp: new Date(),
footer: {
text: "Created by naseif",
icon_url: "https://i.imgur.com/KrAvM8U.jpg",
},
};

await interaction.followUp({ embeds: [embed] });
},
};
1 change: 0 additions & 1 deletion commands/misc/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
.setDescription("ping the bot connection to the server"),
async execute(interaction, client) {
await interaction.deferReply();

const embed = {
title: "Ping Pong!",
description: `📡 **Ping:** ${client.ws.ping}
Expand Down

0 comments on commit 923e6d9

Please sign in to comment.