# djs-vidar

> An extremely simplistic method-based slash command handler for Discord.js v14.

Latest version **1.0.0** (published 2023-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install djs-vidar
pnpm add djs-vidar
yarn add djs-vidar
bun add djs-vidar
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-03-23 |
| First published | 2023-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 16.x |
| Dependencies | 2 |
| Unpacked size | 137.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Cannicide |
| Maintainers | cannicide |
| Keywords | discord, djs, command, handler, slash, vidar, cannicide, discord.js, elisif |

## Links

- npm: https://www.npmjs.com/package/djs-vidar
- Repository: https://github.com/Cannicide/vidar
- Homepage: https://github.com/Cannicide/vidar#readme
- Issues: https://github.com/Cannicide/vidar/issues
- npm.io page: https://npm.io/package/djs-vidar

## Dependencies (2)

- [discord.js](https://npm.io/package/discord.js.md) ^14.8.0
- [discord-api-types](https://npm.io/package/discord-api-types.md) ^0.37.36

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-03-23

## README

# djs-vidar
An extremely simplistic method-based slash command handler for Discord.js v14.\
The successor to the powerful `elisif` framework.

## Usage
Install Vidar using npm:

```
npm install djs-vidar
```

See [the docs](https://github.com/Cannicide/vidar/tree/main/docs/docs.md) for full usage information.

## Basic Comparison
Most slash command handlers I've encountered are, in my opinion, more complicated than necessary. They usually have either massive nested object literals, or a dozen lines worth of methods (with an individual method for each property of a command) for creating basic commands. I sought to simplify that immensely, so I created a module called `elisif` (and an extension of it called `elisif-simple`) for Discord.js v13 that used a basic command syntax to make the process a little simpler. Now, I have created a far simpler syntax system with far more advanced functionality to make the process as simple as it can get, all with support for the latest version of Discord.js v14 -- and `djs-vidar` is much easier to keep updated than the bloated `elisif` module.

Here's a comparison between Discord.js' built-in command-building system and Vidar's highly simplified system.\
Here's Discord.js:
```js
module.exports = {
    data: new SlashCommandBuilder()
        .setName('gif')
        .setDescription('Sends a random gif!')
        .addStringOption(option =>
            option.setName('category')
            .setRequired(true)
            .addChoices(
                { name: 'Funny', value: 'Funny' },
                { name: 'Meme', value: 'Meme' },
                { name: 'Movie', value: 'Movie' },
            )
        )
        .addChannelOption(option =>
            option.setName('output')
            .setRequired(false)
        ),
    execute: i => {
        i.reply('Some gif.');
    }
}
```

And here's Vidar:
```js
command("gif", "Sends a random gif!")
.argument("<category: Funny | Meme | Movie> [output: channel]")
.action(i => {
    i.reply("Some gif");
});
```

As you can see, Vidar makes command creation much simpler, and does not require exports.

## Credits
[Vidar](https://www.npmjs.com/package/djs-vidar) was created by **Cannicide**\
Current dependencies: [discord.js](https://www.npmjs.com/package/discord.js) (v14), [discord-api-types](https://www.npmjs.com/package/discord-api-types) (API v10)

---
_Source: https://npm.io/package/djs-vidar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
