discopic
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

Discopic

import { runBot, createCommand } from "discopic";

const ping = createCommand({
    name: "ping",
    description: "Pongs you back",
    async execute({ ctx }) {
        ctx.reply("pong");
    },
});

runBot({
    token: "SECRET_TOKEN",
    client_id: 0800_00_1066,
    commands: [ping],
});

npm install discopic discord.js

Documentation

Coming Soon... (Probably Never)

Note: / commands are cached on the client. If a created command doesn't show up, try refreshing your discord client (Ctrl + R)

Enviroment Variables

Use can use DISCORD_BOT_TOKEN or DISCORD_BOT_CLIENT_ID enviroment variables instead of passing to runBot, this helps to keep the confirugation out of your code.

Command Error

If you need to error during a command, throw CommandFailedError and it will be returns to the user as a message.

/discopic/

    Package Sidebar

    Install

    npm i discopic

    Homepage

    TODO

    Weekly Downloads

    5

    Version

    0.0.12

    License

    MIT

    Unpacked Size

    332 kB

    Total Files

    173

    Last publish

    Collaborators

    • ben-brady
    • nnilky