An advanced slash command handler for discord
Docs
npm i SlashDiscord.js
or
yarn add SlashDiscord.js
Here is a simple command handler to get you started
const { Client } = require('discord.js');
const { SlashCommandHandler } = require('slashdiscord.js');
const client = new Client();
const handler = new SlashCommandHandler({
client
});
handler.addCommand({
name: 'Hello',
description: 'My first command.'
})
.run(interaction => {
interaction.reply('Hello World!')
})
client.login('YOUR_BOT_TOKEN');
- run npm i or yarn install
- Duplicate the .example.env file and call it .env
- fill in your bot token and client id in the .env file
- execute the command npm test or yarn test