@commandhandler/service-discord.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@commandhandler/service-discord.js

DiscordJS service implementation for @commandhandler/core

Installation

npm i @commandhanlder/core @logmanager/service-discord.js

Quick Start

import { CommandHandler, StandardArgument, Command, RequireArgumentCommandError } from "@commandhandler/core"
import { DiscordImplementation } from "@commandhandler/service-discord.js"

const commandHander = new CommandHandler();

await commandHandler.addService(new DiscordImplementation.createClient(process.env.DISCORD_TOKEN))

class PingCommand extends Command<StandardArgument> {
    readonly name = "ping"
    readonly description = "Ping command"

    async onExec(context: CommandExecutionContext, event: CommandExecEvent<Dispatcher, PingCommand>): Promise<void> {
        await event.actions.reply("pong!")
    }
}

await commandHandler.addCommand(new PingCommand())

Package Sidebar

Install

npm i @commandhandler/service-discord.js

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

95.5 kB

Total Files

18

Last publish

Collaborators

  • radioactive-publish-bot