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

discommand-slash

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discommand-slash

- **This package is no longer supported. Accordingly, please use the discommand 4.0.0 version.** - discommand's SlashCommandHandler

latest
Source
npmnpm
Version
3.0.1
Version published
Maintainers
1
Created
Source

discommand-slash

  • This package is no longer supported. Accordingly, please use the discommand 4.0.0 version.
  • discommand's SlashCommandHandler

Installation

this is for discord.js@13

npm i discommand-slash

dev

npm i discommand-slash@next

Example

Usage for TypeScript

index.ts

import { Client, Intents } from 'discord.js'
import { Slash } from 'discommand-slash'
import path = require('path')

const client = new Client({ intents: [Intents.FLAGS.GUILDS] })
const cmd = new Slash(client, {
  path: path.join(__dirname, '/commands'),
  loadType: 'FILE',
})

cmd.loadCommand()

client.login('your_bot_token')

commands/ping.ts

import { SlashCommand, Slash } from 'discommand-slash'
import { CommandInteraction } from 'discord.js'
import { SlashCommandBuilder } from '@discordjs/builders'

export = class extends SlashCommand {
  data = new SlashCommandBuilder().setName('ping').setDescription('Pong!')
  execute(interaction: CommandInteraction, slash: Slash) {
    interaction.reply('Pong!')
  }
}

Usage for Javascript

index.js

const { Client, Intents } = require('discord.js')
const { Slash } = require('discommand-slash')
const path = require('path')

const client = new Client({ intents: [Intents.FLAGS.GUILDS] })
const cmd = new Slash(client, {
  path: path.join(__dirname, '/commands'),
  loadType: 'FILE',
})

cmd.loadCommand()

client.login('your_bot_token')

commands/ping.js

const { SlashCommand } = require('discommand-slash')
const { SlashCommandBuilder } = require('@discordjs/builders')

module.exports = class extends SlashCommand {
  data = new SlashCommandBuilder().setName('ping').setDescription('Pong!')
  execute(interaction, slash) {
    interaction.reply('Pong!')
  }
}

FAQs

Package last updated on 30 Jan 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