Skip to content

Commit

Permalink
Merge pull request #45 from rishabh7923/slash
Browse files Browse the repository at this point in the history
Improved Help Command
  • Loading branch information
jinx-vi-0 authored Oct 11, 2024
2 parents 9d41a46 + 27cb8bc commit 4aec325
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions interactions/commands/help.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import { SlashCommandBuilder } from "discord.js";
import { SlashCommandBuilder, EmbedBuilder, CommandInteraction} from "discord.js";

export default {
data: new SlashCommandBuilder()
.setName('help')
.setDescription('Get the list of commands available for use'),
run: async (interaction) => {
const helpMessage = `**Available Commands:**\n
\`/potd\` - Shows the LeetCode Daily Challenge\n
\`/random [difficulty]\` - Shows a random LeetCode problem (optional: specify difficulty)\n
\`/user <username>\` - Shows user Info\n
\`/streak <username>\` - Shows user Streak Info\n
\`/topics\` - Shows a list of LeetCode topics to choose from\n
\`/help\` - Shows this help message`;
return interaction.reply({ content: helpMessage});
/**
*
* @param {CommandInteraction} interaction
* @returns
*/
run: async (interaction, client=interaction.client) => {
const embed = new EmbedBuilder()
.setDescription(`Hey __${interaction.user.displayName}__ 👋, I am a discord bot which integrates with LeetCode to provide daily challenges, random problems, user information, and more.\n`)
.setColor(0xD1006C)
.addFields(
...client.commands.map(command => ({ name: `> /${command.data.name}`, value: `${command.data.description}`, inline: true })),
{ name: '‎', value: 'Please consider giving me a ⭐ on GitHub ([DDoL](https://github.com/jinx-vi-0/DDoL)) to show your support!'}
)
return interaction.reply({ embeds: [ embed ] });
}
}

0 comments on commit 4aec325

Please sign in to comment.