1.2.5 • Published 3 years ago

discord-slash-command v1.2.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Discord Slash Command

Install

npm i discord-slash-command

Usage

import { ApplicationCommandOptionType, builder } from 'discord-slash-command';
const command = builder('cmd')
    .defaultPermission(true)
    .description('foo')
    .options(options => {
        return options
            .option(option => {
                return option
                    .type(ApplicationCommandOptionType.SUB_COMMAND)
                    .name('foo')
                    .description('bar')
                    .choices(choices => {
                        return choices
                            .choice(choice => {
                                return choice
                                    .name('choice1')
                                    .value('choice1');
                            });
                    });
            });
    })
    .command;
/*
 * output
 *
 * {
 *     "name": "cmd",
 *     "description": "foo",
 *     "options": [
 *         {
 *             "type": 1,
 *             "name": "foo",
 *             "description": "bar",
 *             "choices": [
 *                 {
 *                     "name": "choice1",
 *                     "value": "choice1"
 *                 }
 *             ]
 *         }
 *     ],
 *     "default_permission": true
 * }
 */
1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago