New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

discommand-lite

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discommand-lite

discommand, but Command Handler only

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

discommand-lite

discommand, but Command Handler only

Installation

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

Example

Usage for TypeScript

index.ts

import { CommandHandler, LoadType } from '@discommand/lite'
import { Client, GatewayIntentBits } from 'discord.js'
import * as path from 'path'

const client = new Client({
  intents: [GatewayIntentBits.Guilds],
})
const cmd = new CommandHandler(client, {
  loadType: LoadType.File,
  directory: path.join(__dirname, 'commands'),
})

cmd.loadAll()
client.login('your_bot_token')

commands/ping.ts

import { Command } from '@discommand/lite'
import { ChatInputCommandInteraction } from 'discord.js'

export default class extends Command {
  name = 'ping'
  description = 'pong'
  execute(interaction: ChatInputCommandInteraction) {
    interaction.reply('Pong!')
  }
}

Usage for Javascript

index.js

const { CommandHandler, LoadType } = require('@discommand/lite')
const { Client, GatewayIntentBits } = require('discord.js')
const path = require('path')

const client = new Client({
  intents: [GatewayIntentBits.Guilds],
})
const cmd = new CommandHandler(client, {
  loadType: LoadType.File,
  directory: path.join(__dirname, 'commands'),
})

cmd.loadAll()
client.login('your_bot_token')

commands/ping.js

const { Command } = require('@discommand/lite')

module.exports = class extends Command {
  name = 'ping'
  description = 'pong'
  execute(interaction) {
    interaction.reply('Pong!')
  }
}

Keywords

discord.js

FAQs

Package last updated on 03 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts