Skip to content
GitHub

MessageHandlerEntry

interface in meocord/core Since 4.1.0

interface MessageHandlerEntry extends HandlerEntryBase

A registered @MessageHandler, a message command or a listener for every message, as the registry lists it.

A message command is listed once, with its aliases, description, scope and usage, which is what a help command needs.

Members

kind

kind: 'message'

Marks a message handler, so kind narrows a HandlerEntry to this type.

name

name: string | undefined

The pattern, or undefined for a handler that takes every message.

command

command: string | undefined

The command words the pattern begins with, such as config set; undefined when it begins with a param.

aliases

aliases: readonly string[]

The other command words the handler takes, from its aliases option.

description

description: string | undefined

What the command does, from its description option.

scope

scope: MessageScope

Where the command works: its scope option, narrowed to servers by a member, role or channel param or flag.

hidden

hidden: boolean

Whether its hidden option leaves it out of help's lists, including a parent's list of subcommands.

usage

usage(prefix?: string): string | undefined

The command as a user types it, after prefix: usage('!') gives !ban <target> [duration] [reason…]. undefined for a handler that takes every message.

Parameters

NameTypeDescription
prefix?string

Returns

string | undefined

matches

matches(words: string): boolean

Whether words name this command or one of its aliases, as a help command's argument does: ban or b. Compared in any case unless the handler, or the app, is case-sensitive.

Parameters

NameTypeDescription
wordsstring

Returns

boolean

See also