Skip to main content
Module

x/harmony/mod.ts>CommandClient

An easy to use Discord API Library for Deno.
Latest
class CommandClient
extends Client
import { CommandClient } from "https://deno.land/x/harmony@v2.9.0/mod.ts";

Harmony Client with extended functionality for Message based Commands parsing and handling.

See InteractionsClient (Client#slash) for more info about Slash Commands.

Constructors

new
CommandClient(options: CommandClientOptions)

Properties

private
readonly
lastUsed: Map<string, { global: number; commands: { [key: string]: number; }; }>
allowBots: boolean
allowDMs: boolean
caseSensitive: boolean
categories: CategoriesManager
commands: CommandsManager
extensions: ExtensionsManager
getChannelPrefix: (channelID: string) => PrefixReturnType
getGuildPrefix: (guildID: string) => PrefixReturnType
getUserPrefix: (userID: string) => PrefixReturnType
globalCommandCooldown: number
globalCooldown: number
isChannelBlacklisted: (channelID: string) => boolean | Promise<boolean>
isGuildBlacklisted: (guildID: string) => boolean | Promise<boolean>
isUserBlacklisted: (userID: string) => boolean | Promise<boolean>
mentionPrefix: boolean
middlewares: Array<CommandContextMiddleware<CommandContext>>
owners: string[]
prefix: PrefixType
spacesAfterPrefix: boolean

Methods

processMessage(msg: Message): Promise<any>

Processes a Message to Execute Command.

use<T extends CommandContext>(middleware: CommandContextMiddleware<T>): this

Adds a Middleware Function to Command Client to pre-process all Commands, and can even modify the Context to include additional properties, methods, etc.