DiscordJS service implementation for @commandhandler/core
DiscordJS service implementation for @commandhandler/core
``bash`
npm i @commandhanlder/core @logmanager/service-discord.js
`typescript
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
readonly name = "ping"
readonly description = "Ping command"
async onExec(context: CommandExecutionContext, event: CommandExecEvent
await event.actions.reply("pong!")
}
}
await commandHandler.addCommand(new PingCommand())
``