Utilities
applyDecoratorsComposes several class or method decorators into one.
cooldownMessageThe wait before a cooldown allows another call, in plain English, such as "Slow down: try again in 12s.": the message of a
CooldownError, for logs and tests.cooldownStoreMessageThe answer the built-in fallback gives a call
CooldownStoreErrorrefused, in English.createMetadataCreates a typed decorator for facts about a handler that guards and other stages read.
createTokenCreates a token to provide and inject a value by, typed with what it provides.
DiscordLimitsDiscord's length and count limits for what a bot sends, in characters as
string.lengthcounts them.ExecutionContextDescribes one handler call: which controller and method run, with which arguments, and the metadata on them.
factoryProviderMakes a factory provider whose function is typed from its
injectlist and its token.getInstallContextReports where an interaction happened and whether the bot is present there.
isExplainedErrorWhether MeoCord has already logged what went wrong and what to do about it.
LoggerPrints timestamped lines to the console, each named with the app and a context, at a level the config can hide.
routeMakes a typed route from a customId pattern, so one declaration serves the handler and the ids that reach it.
SetMetadataDeprecatedAttaches a value to a controller or a handler under a string key of your choosing.
splitMessageSplits text into messages Discord takes, each at most
maxcharacters, keeping code and characters whole.ThemeCacheAn app's cache of the themes
@MeoCord({ themeFor })looked up, by server and by user.truncateShortens text to at most
maxcharacters, ending it with an ellipsis when it was cut.
Commands
commandMentionA clickable mention of one of the app's slash commands, a subcommand or a grouped subcommand, as
</settings channel:123>.
Cooldown stores
CooldownStoreWhere
@Cooldowncounts calls.MemoryCooldownStoreCounts cooldown calls in this process's memory: the store
@Cooldownuses unless another is bound.RedisCooldownStoreA
CooldownStoreon Redis, or on any server that speaks its protocol and runs its Lua scripts.ShardedCooldownStoreA
CooldownStorefor process sharding that needs no database.
Localisation
createTranslatorCreates the application's translator from one catalog per locale.
defineCatalogDeclares a message catalog, keeping each message's text as its type so the params it takes can be checked.
formatDurationWrites a length of time for people, such as
1h 5mor1 hour, 5 minutes, in the language of the user or server it is for.permissionNamesThe permissions as a server owner reads them in Discord's role settings, such as
Ban MembersforBanMembers, in the language of the user or server they are for.translateErrorThe text MeoCord's fallback answers an error with, in a user's or a server's language.
TranslatorTranslates messages from one catalog per locale, typed by the default one.
Pipeline stages
OwnerGuardLets only the user whose id a component's customId carries use it.
Re-exported from discord.js
Imported from meocord/common, these are discord.js's own, the same as importing them from it. discord.js's documentation describes them.
FacesGuildNavigationMentionsHeadingLevelTimestampStylesapplicationDirectoryblockQuoteboldchannelLinkchannelMentionchatInputApplicationCommandMentioncodeBlockemailescapeBoldescapeBulletedListescapeCodeBlockescapeEscapeescapeHeadingescapeInlineCodeescapeItalicescapeMarkdownescapeMaskedLinkescapeNumberedListescapeSpoilerescapeStrikethroughescapeUnderlineformatEmojiheadinghideLinkEmbedhyperlinkinlineCodeitaliclinkedRoleMentionmessageLinkorderedListphoneNumberquoteroleMentionspoilerstrikethroughsubtexttimeunderlineunorderedListuserMentiontype EscapeMarkdownOptionstype FormatEmojiOptionstype RecursiveArraytype TimestampStylesString