Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/harmony/src/commands/mod.ts>CommandBuilder

An easy to use Discord API Library for Deno.
Go to Latest
class CommandBuilder
extends Command
import { CommandBuilder } from "https://deno.land/x/harmony@v2.6.0/src/commands/mod.ts";

Methods

addAlias(alias: string | string[]): CommandBuilder
addExample(examples: string | string[]): CommandBuilder
addUsage(usage: string | string[]): CommandBuilder
onAfterExecute<T extends CommandContext = CommandContext>(fn: <T2>(ctx: T, executeResult?: T2) => unknown | Promise<unknown>): CommandBuilder
onBeforeExecute<T extends CommandContext = CommandContext>(fn: (ctx: T) =>
| boolean
| Promise<boolean>
| unknown
| Promise<unknown>
): CommandBuilder
onExecute<T extends CommandContext = CommandContext>(fn: (ctx: T) => unknown | Promise<unknown>): CommandBuilder
setAlias(alias: string | string[]): CommandBuilder
setBotPermissions(perms?: string | string[]): CommandBuilder
setCategory(category?: string): CommandBuilder
setDescription(description?: string): CommandBuilder
setExample(examples: string | string[]): CommandBuilder
setGuildOnly(value?: boolean): CommandBuilder
setName(name: string): CommandBuilder
setNSFW(value?: boolean): CommandBuilder
setOwnerOnly(value?: boolean): CommandBuilder
setPermissions(perms?: string | string[]): CommandBuilder
setRoles(roles: string | string[]): CommandBuilder
setSubCommands(subCommands: Command[]): this
setUsage(usage: string | string[]): CommandBuilder
setUserPermissions(perms?: string | string[]): CommandBuilder
setWhitelistedChannels(list: string | string[]): CommandBuilder
setWhitelistedGuilds(list: string | string[]): CommandBuilder
setWhitelistedUsers(list: string | string[]): CommandBuilder
subCommand(command: Command): this