No description
  • JavaScript 50.3%
  • TypeScript 49.7%
Find a file
2022-03-29 23:31:01 -05:00
discord fixed compiling 2022-03-29 23:31:01 -05:00
lib done i think 2022-03-29 23:25:06 -05:00
src done i think 2022-03-29 23:25:06 -05:00
.gitignore done i think 2022-03-29 23:25:06 -05:00
buildexample.js init 2022-03-29 22:31:38 -05:00
LICENSE init 2022-03-29 22:31:38 -05:00
package.json done i think 2022-03-29 23:25:06 -05:00
pnpm-lock.yaml init 2022-03-29 22:31:38 -05:00
README.md init 2022-03-29 22:31:38 -05:00
tsconfig.json init 2022-03-29 22:31:38 -05:00

discordslash

Discord Application Commands made easy

usage

run npm run buildexample <token> to compile example(s)

examples/main.ts

import { Client, CommandInteraction, Intents } from 'discord.js';
import { addCommand, CommandGenerator, CommandOptionGenerator, initClient } from '../';

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

initClient(client);

addCommand([
    new CommandGenerator()
        .setName('ping')
        .setDescription('ping me')
        .setRun((interaction: CommandInteraction) =>
            interaction.reply('pong')),
            
    new CommandGenerator()
        .setName('8ball')
        .setDescription('ask the magic 8ball a question')
        .addOption([

            new CommandOptionGenerator()
                .setName('question')
                .setType('string')
                .setDescription('question to ask the 8ball')
                .setRequired()

        ])
        .setRun(EightBall)
]);

client.login(TOKEN);

TODO

  • quick option functions
  • non global commmands