1.0.0 • Published 1 year ago

discord.js-slasher v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Slasher is a framework to simplify the creation of Discord bots.

Forget about SlashCommandBuilder and REST. Slasher takes care of all of it for you, and provides a simple, easy-to-use interface to build your bot using slash commands.

Even if you're not using discord.js to build your bot, you can still make use of the handy CLI tool to make adding slash commands painless!

Slasher currently supports discord.js v14 ONLY. The package will no longer work with v13.

Guides

If you are using Slasher for the first time, please see the Getting Started guide.

If you are migrating an existing bot, please see the Slasher Migration guide.

Install

Install for use in a node project

npm i -s discord.js discord.js-slasher

Install the CLI tool for another language

npm i -g discord.js-slasher

Example

First we create our commands.json definition file:

{
    "test": {
        "description": "My first command on Discord!"
    }
}

Then run the slasher utility and follow the prompts to upload it to Discord!

$ npx slasher

Then we can create our bot!

const { Events } = require("discord.js");
const { SlasherClient, SlasherEvents } = require("discord.js-slasher");
// alternatively use import statements

const client = new SlasherClient();

client.on(Events.ClientReady, () => {
    console.log("Logged in as " + client.user.tag);
});

client.on(SlasherEvents.CommandCreate, (ctx) => {
    ctx.reply(`Howdy ${ctx.user.tag}!`);
});

client.login();

Thanks

1.0.0

1 year ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago