Detritus Client
A wheels-attached, pure-TypeScript library for the Discord API. Connect shards, cache everything, run prefix and slash commands, and join voice, all from one package.
On this page
Overview
detritus-client is the high-level package. It wraps the REST layer (detritus-client-rest) and the Gateway layer (detritus-client-socket) and turns raw payloads into cached, typed structures like Structures.Message and Structures.Guild.
You pick a client class depending on how big your bot is and what it does:
| Class | Use it when |
|---|---|
ShardClient | You want a single gateway connection and its events. Every other client is built from these. |
ClusterClient | You want several shards inside one process. It creates ShardClients for you. |
CommandClient | You want prefix commands like !ping. It wraps a ClusterClient (or a ShardClient). |
InteractionCommandClient | You want slash commands and context menus. It also wraps a cluster or shard client. |
ClusterManager | Your bot is big enough to need several processes, each running a ClusterClient. |
The two command clients can share one underlying client, so a bot can have prefix commands and slash commands at the same time.
Installation
npm install detritus-client@betaThis guide covers the 0.17 line, which is published under the beta tag.
The client needs Node 22.19 or newer. Its HTTP layer, detritus-rest, is built on undici and refuses to load on older versions.
Some features need optional packages. Install the ones you use:
| Package | What it enables |
|---|---|
@snazzah/davey (^0.2.0) | Joining voice channels. Discord has required end-to-end encrypted voice (DAVE) since March 1st, 2026. |
@discordjs/opus or opusscript | Encoding and decoding Opus audio for voice. |
sodium-native or libsodium-wrappers | Optional. A faster implementation of the aead_xchacha20_poly1305_rtpsize voice encryption mode. Node's own crypto already covers both voice encryption modes. |
erlpack | The faster etf gateway encoding instead of JSON. |
Keep your bot token out of your source code. The examples here read it from process.env.TOKEN.
Your first bot
A ShardClient is one connection to the gateway. Create it with your token, listen for events, then call run().
import { ShardClient } from 'detritus-client';
const client = new ShardClient(process.env.TOKEN!, {
gateway: {
// message content is a privileged intent, switch it on in the developer portal too
intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT'],
},
});
client.on('guildCreate', ({fromUnavailable, guild}) => {
if (fromUnavailable) {
console.log(`${guild.name} came back from an outage`);
} else {
console.log(`Joined ${guild.name}, now in ${client.guilds.length} guilds`);
}
});
client.on('messageCreate', async ({message}) => {
if (message.content === '!ping') {
const reply = await message.reply('pong!, deleting this in 5 seconds...');
setTimeout(() => reply.delete(), 5000);
}
});
(async () => {
await client.run();
console.log(`Connected with ${client.guilds.length} guilds cached`);
client.gateway.setPresence({
activity: {name: 'with Detritus', type: 0},
status: 'dnd',
});
})();const { ShardClient } = require('detritus-client');
const client = new ShardClient(process.env.TOKEN, {
gateway: {
// message content is a privileged intent, switch it on in the developer portal too
intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT'],
},
});
client.on('guildCreate', ({fromUnavailable, guild}) => {
if (fromUnavailable) {
console.log(`${guild.name} came back from an outage`);
} else {
console.log(`Joined ${guild.name}, now in ${client.guilds.length} guilds`);
}
});
client.on('messageCreate', async ({message}) => {
if (message.content === '!ping') {
const reply = await message.reply('pong!, deleting this in 5 seconds...');
setTimeout(() => reply.delete(), 5000);
}
});
(async () => {
await client.run();
console.log(`Connected with ${client.guilds.length} guilds cached`);
client.gateway.setPresence({
activity: {name: 'with Detritus', type: 0},
status: 'dnd',
});
})();The example asks for the MESSAGE_CONTENT intent on top of the default ones. Without it message.content is empty in servers, so the !ping check would never match.
run() fetches the gateway URL, connects, waits for the READY payload and resolves with the client. Structures like Structures.Message come with helpers for the endpoints that act on them, so message.reply(), reply.delete(), guild.fetchMembers({limit: 100}) and so on map straight to REST calls.
Events
Every client is an event emitter. Events are named in camelCase, like messageCreate or guildMemberAdd, and the listener gets one object as its payload. A few lifecycle events have no payload, like a ClusterClient's ready.
import { GatewayClientEvents, ShardClient } from 'detritus-client';
const client = new ShardClient(process.env.TOKEN!, {
gateway: {intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT']},
});
client.on('messageUpdate', ({differences, message}: GatewayClientEvents.MessageUpdate) => {
if (message && differences && differences.content !== undefined) {
console.log(`${message.author} edited a message: ${differences.content} -> ${message.content}`);
}
});const { ShardClient } = require('detritus-client');
const client = new ShardClient(process.env.TOKEN, {
gateway: {intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT']},
});
client.on('messageUpdate', ({differences, message}) => {
if (message && differences && differences.content !== undefined) {
console.log(`${message.author} edited a message: ${differences.content} -> ${message.content}`);
}
});- The payload type for every event is in the
GatewayClientEventsnamespace, and the list of event names is theConstants.ClientEventsenum. - Update events include
differences, an object holding the old values of whatever changed. - On a
ClusterClient, every payload also has ashardproperty: theShardClientthe event came from. client.subscribe(name, listener)works likeon()but returns anEventSubscriptionyou can.remove()later.
The gateway sends only what your intents allow. By default the client asks for every unprivileged intent. To add privileged ones like message content or members, turn them on in the developer portal, then pass them in. The intents option replaces the default set, so keep 'ALL_UNPRIVILEGED' in the list:
const client = new ShardClient(process.env.TOKEN, {
gateway: {
// 'ALL', 'ALL_UNPRIVILEGED', a bitfield, or a list of names/numbers
intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT', 'GUILD_MEMBERS'],
},
});Sharding with ClusterClient
Discord requires bots in 2,500+ guilds to shard. A ClusterClient runs a set of shards inside one process and forwards all of their events.
import { ClusterClient } from 'detritus-client';
const cluster = new ClusterClient(process.env.TOKEN!, {
gateway: {
intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT'],
presence: {activity: {name: 'with Detritus', type: 0}, status: 'dnd'},
},
// shardCount: 4, leave out to use Discord's recommended count
// shards: [0, 1], inclusive [first, last] range of shard ids this process should run
});
cluster.on('messageCreate', async ({message, shard}) => {
if (message.content === '!ping') {
await message.reply(`pong from shard #${shard.shardId}!`);
}
});
(async () => {
await cluster.run();
console.log(`Launched shards ${cluster.shardStart} to ${cluster.shardEnd} of ${cluster.shardCount}`);
})();const { ClusterClient } = require('detritus-client');
const cluster = new ClusterClient(process.env.TOKEN, {
gateway: {
intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT'],
presence: {activity: {name: 'with Detritus', type: 0}, status: 'dnd'},
},
// shardCount: 4, leave out to use Discord's recommended count
// shards: [0, 1], inclusive [first, last] range of shard ids this process should run
});
cluster.on('messageCreate', async ({message, shard}) => {
if (message.content === '!ping') {
await message.reply(`pong from shard #${shard.shardId}!`);
}
});
(async () => {
await cluster.run();
console.log(`Launched shards ${cluster.shardStart} to ${cluster.shardEnd} of ${cluster.shardCount}`);
})();The shards live in cluster.shards once run() resolves. cluster.run() resolves once every shard has started connecting, before they are all ready. They're started one bucket at a time, following the session's max_concurrency.
Multiple processes with ClusterManager
When one process isn't enough, a ClusterManager forks child processes and gives each a range of shards. The child file creates its client without a token; it reads the token and shard range from the environment the manager sets up.
import { ClusterManager } from 'detritus-client';
const manager = new ClusterManager('./child.js', process.env.TOKEN!, {
shardCount: 6,
shardsPerCluster: 2,
});
(async () => {
await manager.run();
console.log('Running 3 clusters with 2 shards each');
})();const { ClusterManager } = require('detritus-client');
const manager = new ClusterManager('./child.js', process.env.TOKEN, {
shardCount: 6,
shardsPerCluster: 2,
});
(async () => {
await manager.run();
console.log('Running 3 clusters with 2 shards each');
})();import { CommandClient } from 'detritus-client';
// no token here, the manager passes it to the fork
const commandClient = new CommandClient('', {
prefix: '!!',
gateway: {intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT']},
});
commandClient.add({name: 'ping', run: (context) => context.reply('pong')});
(async () => {
await commandClient.run();
})();const { CommandClient } = require('detritus-client');
// no token here, the manager passes it to the fork
const commandClient = new CommandClient('', {
prefix: '!!',
gateway: {intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT']},
});
commandClient.add({name: 'ping', run: (context) => context.reply('pong')});
(async () => {
await commandClient.run();
})();The child can be a ClusterClient, CommandClient or InteractionCommandClient. Point the manager at the compiled file if you write the child in TypeScript.
manager.run() gives each cluster 30 seconds per shard to become ready. A cluster that takes longer is killed and started again while the other clusters keep launching, and its ClusterProcess emits warn (the manager's clusterProcess event hands you each one as it's created). Killing a cluster sends SIGTERM, then SIGKILL if the child hasn't exited 10 seconds later. A child whose manager goes away kills its own client.
Prefix commands
A CommandClient reads messages, matches a prefix and a command name, parses arguments and calls your run function with a Command.Context.
import { CommandClient } from 'detritus-client';
interface EchoArgs {
reverse: boolean,
text: string,
}
const commandClient = new CommandClient(process.env.TOKEN!, {
prefix: '..', // or prefixes: ['..', '!']
// "@bot ping" works too, mentionsEnabled: false turns that off
gateway: {
// message content is a privileged intent, the prefix can't match in servers without it
intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT'],
},
});
commandClient.add({
name: 'ping',
run: (context) => context.reply('pong!'),
});
commandClient.add({
name: 'echo',
label: 'text', // the text after the command name ends up in args.text
args: [{name: 'reverse', type: 'bool', aliases: ['backwards']}],
onBeforeRun: (context, args: EchoArgs) => !!args.text,
onCancelRun: (context) => context.reply('Give me something to echo.'),
run: (context, args: EchoArgs) => {
const text = args.reverse ? args.text.split('').reverse().join('') : args.text;
return context.editOrReply(text);
},
});
commandClient.add({
name: 'owner',
// return false to stop the command, then onCancel is called
onBefore: (context) => context.client.isOwner(context.userId),
onCancel: (context) => context.reply('This command is only for the bot owner.'),
run: (context) => context.reply('Hello, owner.'),
});
(async () => {
const client = await commandClient.run();
console.log(`Loaded with ${client.shardCount} shards`);
})();const { CommandClient } = require('detritus-client');
const commandClient = new CommandClient(process.env.TOKEN, {
prefix: '..', // or prefixes: ['..', '!']
// "@bot ping" works too, mentionsEnabled: false turns that off
gateway: {
// message content is a privileged intent, the prefix can't match in servers without it
intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT'],
},
});
commandClient.add({
name: 'ping',
run: (context) => context.reply('pong!'),
});
commandClient.add({
name: 'echo',
label: 'text', // the text after the command name ends up in args.text
args: [{name: 'reverse', type: 'bool', aliases: ['backwards']}],
onBeforeRun: (context, args) => !!args.text,
onCancelRun: (context) => context.reply('Give me something to echo.'),
run: (context, args) => {
const text = args.reverse ? args.text.split('').reverse().join('') : args.text;
return context.editOrReply(text);
},
});
commandClient.add({
name: 'owner',
// return false to stop the command, then onCancel is called
onBefore: (context) => context.client.isOwner(context.userId),
onCancel: (context) => context.reply('This command is only for the bot owner.'),
run: (context) => context.reply('Hello, owner.'),
});
(async () => {
const client = await commandClient.run();
console.log(`Loaded with ${client.shardCount} shards`);
})();Arguments are flags written as -name value. Each has a type ('string', 'number', 'bool', or your own converter function), optional default, choices and aliases. When a conversion throws, onTypeError gets an object of errors keyed by argument name.
A command runs in this order: DM check → the bot's permissions (permissionsClient) → the user's permissions (permissions) → ratelimit check → onBefore → argument parsing → onBeforeRun → run → onSuccess. The paths that stop early call onDmBlocked, onPermissionsFailClient, onPermissionsFail, onRatelimit, onCancel, onTypeError or onCancelRun. An error thrown by run goes to onRunError(context, args, error). onError(context, args, error) gets what onBeforeRun, onCancelRun or onSuccess throw. An error thrown by onBefore or onCancel only emits the commandError event.
Use context.editOrReply() instead of context.reply(). With activateOnEdits: true on the CommandClient, a user editing their message runs the command again, and it edits its earlier reply instead of sending a new one. Edits only count within maxEditDuration of the message being sent (5 minutes by default).
Command classes and folders
For bigger bots, put each command in its own file and load the folder with addMultipleIn(). A file can export a plain options object or a class extending Command.Command.
import { Command, CommandClient } from 'detritus-client';
export interface CommandArgs {
amount: number,
}
export default class RollCommand extends Command.Command {
constructor(client: CommandClient, options: Command.CommandOptions) {
super(client, {
...options,
name: 'roll',
label: 'amount',
type: Number,
default: 1,
// only allow 1 to 20 rolls
choices: Array.from({length: 20}, (value, key) => key + 1),
help: 'Roll some dice, 1 to 20 at a time',
});
}
run(context: Command.Context, args: CommandArgs) {
const rolls = Array.from({length: args.amount}, () => Math.ceil(Math.random() * 100));
return context.editOrReply(`Rolls: ${rolls.join(', ')}`);
}
}const { Command } = require('detritus-client');
class RollCommand extends Command.Command {
constructor(client, options) {
super(client, {
...options,
name: 'roll',
label: 'amount',
type: Number,
default: 1,
// only allow 1 to 20 rolls
choices: Array.from({length: 20}, (value, key) => key + 1),
help: 'Roll some dice, 1 to 20 at a time',
});
}
run(context, args) {
const rolls = Array.from({length: args.amount}, () => Math.ceil(Math.random() * 100));
return context.editOrReply(`Rolls: ${rolls.join(', ')}`);
}
}
module.exports = RollCommand;import { CommandClient } from 'detritus-client';
const commandClient = new CommandClient(process.env.TOKEN!, {
prefix: '!!',
gateway: {intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT']},
});
(async () => {
// paths are relative to the file the process was started with, pass {isAbsolute: true} to give a full path
await commandClient.addMultipleIn('./commands');
await commandClient.run();
})();const { CommandClient } = require('detritus-client');
const commandClient = new CommandClient(process.env.TOKEN, {
prefix: '!!',
gateway: {intents: ['ALL_UNPRIVILEGED', 'MESSAGE_CONTENT']},
});
(async () => {
// paths are relative to the file the process was started with, pass {isAbsolute: true} to give a full path
await commandClient.addMultipleIn('./commands');
await commandClient.run();
})();Only .js, .cjs and .mjs files are loaded, so compile TypeScript commands first. .ts files are only loaded when running under ts-node.
A shared base class is a good place for handlers every command needs, like formatting onTypeError the same way everywhere.
Slash commands
An InteractionCommandClient registers application commands with Discord and routes interactions to them. When it starts it compares your local commands with the ones Discord has and only uploads what changed.
import { Constants, Interaction, InteractionCommandClient } from 'detritus-client';
const { ApplicationCommandOptionTypes, ApplicationCommandTypes, MessageFlags } = Constants;
const interactionClient = new InteractionCommandClient(process.env.TOKEN!);
interactionClient.add({
name: 'ping',
description: 'Ping!',
run: (context) => context.editOrRespond('pong!'),
});
interactionClient.add({
name: 'avatar',
description: 'Show someone\'s avatar',
options: [
{
name: 'user',
description: 'Whose avatar to show',
type: ApplicationCommandOptionTypes.USER,
// defaults can be functions of the context
default: (context: Interaction.InteractionContext) => context.member || context.user,
},
],
run: (context, args) => context.editOrRespond(args.user.avatarUrl),
});
// right click a user > Apps > Poke
interactionClient.add({
name: 'Poke',
type: ApplicationCommandTypes.USER,
run: (context, args) => context.editOrRespond({
content: `You poked ${args.member || args.user}`,
flags: MessageFlags.EPHEMERAL,
}),
});
(async () => {
const client = await interactionClient.run();
console.log(`Loaded with ${client.shardCount} shards`);
})();const { Constants, InteractionCommandClient } = require('detritus-client');
const { ApplicationCommandOptionTypes, ApplicationCommandTypes, MessageFlags } = Constants;
const interactionClient = new InteractionCommandClient(process.env.TOKEN);
interactionClient.add({
name: 'ping',
description: 'Ping!',
run: (context) => context.editOrRespond('pong!'),
});
interactionClient.add({
name: 'avatar',
description: 'Show someone\'s avatar',
options: [
{
name: 'user',
description: 'Whose avatar to show',
type: ApplicationCommandOptionTypes.USER,
// defaults can be functions of the context
default: (context) => context.member || context.user,
},
],
run: (context, args) => context.editOrRespond(args.user.avatarUrl),
});
// right click a user > Apps > Poke
interactionClient.add({
name: 'Poke',
type: ApplicationCommandTypes.USER,
run: (context, args) => context.editOrRespond({
content: `You poked ${args.member || args.user}`,
flags: MessageFlags.EPHEMERAL,
}),
});
(async () => {
const client = await interactionClient.run();
console.log(`Loaded with ${client.shardCount} shards`);
})();- Pass
guildIds: ['...']to register a command in specific guilds instead of globally. Guild commands update instantly, which is handy while developing. - Sub-commands and groups are options whose
typeisSUB_COMMANDorSUB_COMMAND_GROUP, or instances ofInteraction.InteractionCommandOptionwith their ownrun. context.editOrRespond()responds the first time and edits the response after that. For slow work, callcontext.respond(InteractionCallbackTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE)first.- An interaction gets one initial response. A second
respond()rejects right away instead of reaching Discord, andcontext.responseTypesays which response was sent. After a modal or autocomplete response there's no message to edit, soeditOrRespond()throws. - Followups (
context.createMessage()) and edits wait for the initial response to finish, so a followup right after a deferral fills the loading message. addMultipleIn('./commands')works here too, with classes extendingInteraction.InteractionCommand.
The same hooks as prefix commands exist (onBefore, onCancel, onRunError, ...), along with the same permissions / permissionsClient checks and onDmBlocked for disableDm commands. One name differs: argument errors call onValueError here, where prefix commands call onTypeError.
Command permissions
Servers can limit who uses your commands, and where, in Server Settings > Integrations: per command, or for the whole app. Discord enforces this itself only for slash commands used through the server install. A prefix command, or a user install command used in a server, reaches you no matter what the server set, so check those yourself:
// in a prefix command's onBefore, or a user install command's onBefore
async onBefore(context) {
const { channel, guildId, member } = context;
if (!guildId || !channel || !member) {
return true;
}
try {
await context.client.applicationCommandPermissions.fill(guildId);
} catch(error) {
// no `applications.commands` scope in this server, nothing to check
}
// the matching slash command's ids (global and guild), or [] to only use the app-wide settings
const commandIds = [slashCommandId];
return context.client.applicationCommandPermissions.isAllowed(guildId, commandIds, channel, member);
}- The cache is on by default and starts empty. With it turned off (
cache: {applicationCommandPermissions: false}, orcache: false)fill()does nothing andisAllowed()allows everyone.fill(guildId)fetches a server once, callers asking at the same time share the request, and gateway updates keep it current after that. A new session clears it. - A command with its own settings ignores the app-wide ones, like Discord does. Administrators are always allowed, and a server with nothing cached allows everything.
- A server that installed the bot without the
applications.commandsscope failsfill()every time until it reinstalls the bot. Remember those failures for a while instead of fetching again on every command.
Embeds and markup
Utils.Embed builds embeds with chainable setters, and Utils.Markup formats and escapes text.
import { Utils } from 'detritus-client';
const { Embed, Markup } = Utils;
const embed = new Embed();
embed.setTitle('Server info');
embed.setColor(0x5865f2);
embed.setDescription(Markup.bold(guild.name));
embed.addField('Members', String(guild.memberCount), true);
if (guild.iconUrl) {
embed.setThumbnail(guild.iconUrl);
}
embed.setTimestamp();
await message.reply({embed});
// escaping user input before putting it in a message
await message.reply(`You said: ${Markup.escape.all(message.content)}`);
await message.reply(Markup.codeblock(JSON.stringify(data, null, 2), {language: 'json'}));const { Utils } = require('detritus-client');
const { Embed, Markup } = Utils;
const embed = new Embed();
embed.setTitle('Server info');
embed.setColor(0x5865f2);
embed.setDescription(Markup.bold(guild.name));
embed.addField('Members', String(guild.memberCount), true);
if (guild.iconUrl) {
embed.setThumbnail(guild.iconUrl);
}
embed.setTimestamp();
await message.reply({embed});
// escaping user input before putting it in a message
await message.reply(`You said: ${Markup.escape.all(message.content)}`);
await message.reply(Markup.codeblock(JSON.stringify(data, null, 2), {language: 'json'}));Most send methods take an embed, an embeds array, components, files and allowedMentions alongside content.
Caching
Every structure the gateway sends is cached in a collection on the client: client.guilds, client.channels, client.members, client.messages, client.users and so on. Collections are Map-like (get, has, filter, find, map, first, length...).
Each cache can be turned off or tuned with cache options. A cache option is either a boolean or {enabled, expire, limit}:
const client = new ShardClient(process.env.TOKEN, {
cache: {
messages: {expire: 30 * 60 * 1000}, // keep messages for 30 minutes (default is 10)
presences: false, // don't store presences at all
users: {limit: 50000}, // evict the least recently used past 50k
},
});Pass cache: false to disable every cache, useful for a bot that only answers interactions. Structures still work without the cache; you'll just need to fetch what you need, like client.rest.fetchGuild(guildId).
Voice
Join a channel with client.voiceConnect() (or channel.join({}) on a voice channel, in TypeScript the result is only typed when you pass an options object). You get back the VoiceConnection and whether it's new or was reused.
const voice = await client.voiceConnect(guildId, channelId, {receive: true});
if (!voice) {
throw new Error('Could not join the channel');
}
const { connection, isNew } = voice;
if (isNew) {
connection.setSpeaking({voice: true});
// send a silence frame so Discord starts sending us audio
connection.sendAudioSilenceFrame();
connection.on('packet', ({data, userId}) => {
if (userId === targetUserId) {
connection.sendAudio(data, {isOpus: true});
}
});
}connection.ready says whether audio can be sent right now. It goes false while the connection reconnects. Calls like setSpeaking() that are made during a reconnect resolve without being sent, so set them again on the connection's ready event.
Voice needs @snazzah/davey for DAVE end-to-end encryption, and an Opus package to encode or decode audio. AudioMixer can mix decoded audio from several users into one PCM stream. Call connection.kill() to leave.
Going lower level
Everything the high-level client does is available underneath it:
- On a
ShardClient,client.restis a REST client with the same methods asdetritus-client-rest'sClient(likecreateMessageorfetchGuild), but it returns structures instead of raw objects. The raw client is atclient.rest.raw. Its events come through the client asrestRequest,restResponseandrestTokenUnauthorized(once per shard when the token gets a401withhaltOnUnauthorizedon). On aClusterClient,restis the rawdetritus-client-restclient itself, and so iscommandClient.restwhen the command client wraps a cluster (the default). Use a shard'srestorcontext.restto get structures. client.gatewayis thedetritus-client-socketgateway connection, for things likesetPresence()orrequestGuildMembers().GatewayRawEventsdescribes the raw payloads, before they're turned into structures.
Read the Client Rest and Client Socket docs for those layers.
Namespaces
Grouped exports, reached as properties of the package.
Classes
Classes you create or receive from the library.
Interfaces
Object shapes for options, payloads and events.
Type aliases
Named types used across the API.
CommandClientCommandCheck
type src/commandclient.ts:54CommandClientMessageCancel
type src/commandclient.ts:57type CommandClientMessageCancel = (context: Context) => unknownCommandClientMessageCheck
type src/commandclient.ts:56type CommandClientMessageCheck = (context: Context) => Promise<boolean> | booleanCommandClientPrefixCheck
type src/commandclient.ts:60type CommandClientPrefixCheck = (context: Context) => CommandClientPrefixes | Promise<CommandClientPrefixes>CommandClientPrefixes
type src/commandclient.ts:59type CommandClientPrefixes = string[] | BaseSet<string> | Set<string> | stringInteractionCommandClientCommandCancel
type src/interactioncommandclient.ts:113type InteractionCommandClientCommandCancel = (context: InteractionContext, command: InteractionCommand) => unknownInteractionCommandClientCommandCheck
type src/interactioncommandclient.ts:112type InteractionCommandClientCommandCheck = (context: InteractionContext, command: InteractionCommand) => Promise<boolean> | booleanInteractionCommandClientInteractionCancel
type src/interactioncommandclient.ts:115type InteractionCommandClientInteractionCancel = (context: InteractionContext) => unknownInteractionCommandClientInteractionCheck
type src/interactioncommandclient.ts:114type InteractionCommandClientInteractionCheck = (context: InteractionContext) => Promise<boolean> | boolean