SkillAgentSearch skills...

Commandhandler

a simple discord.js v14 command framework

Install / Use

/learn @pierokchad/Commandhandler
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

✨ Discord.js v14 command framework

This is a simple and unique package which makes creating commands using .js and .ts a whole lot easier and make the code look cleaner.

[!CAUTION] Some features may not work properly as the project is no longer actively maintained.

🚀 Installation

1. Install package:

# npm
npm install @pierok/commandhandler

# yarn
yarn add @pierok/commandhandler

# pnpm
pnpm install @pierok/commandhandler

<bt></br> 2. In your command file, require the following:

JavaScript:

const { Command } = require('@pierok/commandhandler');

TypeScript:

import { Command, CommandOptions, RunOptions } from '@pierok/commandhandler';

<bt></br>

📑 Code example - command format

JavaScript:

const { Command } = require('@pierok/commandhandler');
const { Client, CommandInteraction, ApplicationCommandType } = require('discord.js');

module.exports = new Command({
    name: "example",
    description: "An example command",
    type: ApplicationCommandType.ChatInput,

    /**
     * @param {Object} options
     * @param {Client} options.client
     * @param {CommandInteraction} options.interaction
     * @param {Array<string>} options.args
     */
    async run({ client, interaction, args }) {
        await interaction.reply("Hello world!");
    },
});

TypeScript:

import { Command, CommandOptions, RunOptions } from '@pierok/commandhandler';
import { Client, CommandInteraction, ApplicationCommandType } from 'discord.js';

const commandOptions: CommandOptions = {
    name: "example",
    description: "An example command",
    type: ApplicationCommandType.ChatInput,

    /**
     * @param {RunOptions} options
     */
    async run({ client, interaction, args }: RunOptions) {
        await interaction.reply("Hello world!");
    },
};

export default new Command(commandOptions);

📑 Code example - subcommand format

JavaScript:

const { Command } = require('@pierok/commandhandler');
const { Client, CommandInteraction, ApplicationCommandType, ApplicationCommandOptionType } = require('discord.js');

module.exports = new Command({
    name: "subcommand",
    description: "A command with subcommands",
    type: ApplicationCommandType.ChatInput,
    options: [
        {
            name: "subcommand",
            description: "A subcommand",
            type: ApplicationCommandOptionType.Subcommand,
            options: [
                {
                    name: "input",
                    description: "Input value",
                    type: ApplicationCommandOptionType.String,
                    required: true
                }
            ]
        }
    ],

    /**
     * @param {Object} options
     * @param {Client} options.client
     * @param {CommandInteraction} options.interaction
     * @param {Array<string>} options.args
     */
    async run({ client, interaction, args }) {
        await interaction.reply(`Subcommand executed with args: ${args.join(', ')}`);
    },
});

TypeScript:

import { Command, CommandOptions, RunOptions } from '@pierok/commandhandler';
import { Client, CommandInteraction, ApplicationCommandType, ApplicationCommandOptionType } from 'discord.js';

const commandOptions: CommandOptions = {
    name: "subcommand",
    description: "A command with subcommands",
    type: ApplicationCommandType.ChatInput,
    options: [
        {
            name: "subcommand",
            description: "A subcommand",
            type: ApplicationCommandOptionType.Subcommand,
            options: [
                {
                    name: "input",
                    description: "Input value",
                    type: ApplicationCommandOptionType.String,
                    required: true
                }
            ]
        }
    ],

    /**
     * @param {RunOptions} options
     */
    async run({ client, interaction, args }: RunOptions) {
        await interaction.reply(`Subcommand executed with args: ${args.join(', ')}`);
    },
};

export default new Command(commandOptions);

[!NOTE] If you have any bugs, please submit them here.

[!NOTE] You can contribute if you want.

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated1mo ago
Forks1

Languages

TypeScript

Security Score

85/100

Audited on Feb 14, 2026

No findings