Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

discommand/discommand-eris

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

105 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discommand

easy discord.js commandHandler

Installation

  • this is use for discord.js@14
  • Required by node.js 16.9.0 or higher
  1. Stable version
npm i discommand
  1. Devlopment version
npm i discommand@next

Example

Usage for TypeScript

index.ts

import { DiscommandClient, LoadType } from 'discommand'
import { GatewayIntentBits } from 'discord.js'

const client = new DiscommandClient(
  {
    intents: [GatewayIntentBits.Guilds],
  },
  {
    loadType: LoadType.File,
    directory: {
      command: __dirname + '/commands',
    },
  }
)

client.loadAll()

client.login('your_bot_token')

commands/ping.ts

import { Command } from 'discommand'
import { ChatInputCommandInteraction, ApplicationCommandType } from 'discord.js'

export default class extends Command {
  constructor() {
    super()
    this.name = 'ping'
    this.description = 'Pong'
    this.type = ApplicationCommandType.ChatInput
  }
  execute(interaction: ChatInputCommandInteraction) {
    interaction.reply('Pong!')
  }
}

Usage for Javascript

index.js

const { DiscommndClient, LoadType } = require('discommand')
const { GatewayIntentBits } = require('discord.js')
const path = require('path')

const client = new DiscommandClient(
  {
    intents: [GatewayIntentBits.Guilds],
  },
  {
    loadType: LoadType.File,
    directory: {
      command: __dirname + '/commands',
    },
  }
)

client.loadAll()

client.login('your_bot_token')

commands/ping.js

const { Command } = require('discommand')
const { SlashCommandBuilder, ApplicationCommandType } = require('discord.js')

module.exports = class extends Command {
  constructor() {
    super()
    this.name = 'ping'
    this.description = 'Pong!'
    this.type = ApplicationCommandType.ChatInput
  }
  execute(interaction) {
    interaction.reply('Pong!')
  }
}

About

easy discord.js commandHandler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 87.9%
  • JavaScript 12.1%