MessageHandlerEntry
interface in meocord/core Since 4.1.0
interface MessageHandlerEntry extends HandlerEntryBaseA 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 | undefinedThe pattern, or undefined for a handler that takes every message.
command
command: string | undefinedThe 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 | undefinedWhat the command does, from its description option.
scope
scope: MessageScopeWhere the command works: its scope option, narrowed to servers by a member, role or channel param or flag.
hidden
hidden: booleanWhether its hidden option leaves it out of help's lists, including a parent's list of subcommands.
usage
usage(prefix?: string): string | undefinedThe command as a user types it, after prefix: usage('!') gives !ban <target> [duration] [reason…].
undefined for a handler that takes every message.
Parameters
| Name | Type | Description |
|---|---|---|
prefix? | string |
Returns
string | undefinedmatches
matches(words: string): booleanWhether 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
| Name | Type | Description |
|---|---|---|
words | string |
Returns
boolean