Skip to content
GitHub

Utilities

  • applyDecorators

    Composes several class or method decorators into one.

  • cooldownMessage

    The 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.

  • cooldownStoreMessage

    The answer the built-in fallback gives a call CooldownStoreError refused, in English.

  • createMetadata

    Creates a typed decorator for facts about a handler that guards and other stages read.

  • createToken

    Creates a token to provide and inject a value by, typed with what it provides.

  • DiscordLimits

    Discord's length and count limits for what a bot sends, in characters as string.length counts them.

  • ExecutionContext

    Describes one handler call: which controller and method run, with which arguments, and the metadata on them.

  • factoryProvider

    Makes a factory provider whose function is typed from its inject list and its token.

  • getInstallContext

    Reports where an interaction happened and whether the bot is present there.

  • isExplainedError

    Whether MeoCord has already logged what went wrong and what to do about it.

  • Logger

    Prints timestamped lines to the console, each named with the app and a context, at a level the config can hide.

  • route

    Makes a typed route from a customId pattern, so one declaration serves the handler and the ids that reach it.

  • SetMetadata Deprecated

    Attaches a value to a controller or a handler under a string key of your choosing.

  • splitMessage

    Splits text into messages Discord takes, each at most max characters, keeping code and characters whole.

  • ThemeCache

    An app's cache of the themes @MeoCord({ themeFor }) looked up, by server and by user.

  • truncate

    Shortens text to at most max characters, ending it with an ellipsis when it was cut.

Commands

  • commandMention

    A clickable mention of one of the app's slash commands, a subcommand or a grouped subcommand, as </settings channel:123>.

Cooldown stores

Localisation

  • createTranslator

    Creates the application's translator from one catalog per locale.

  • defineCatalog

    Declares a message catalog, keeping each message's text as its type so the params it takes can be checked.

  • formatDuration

    Writes a length of time for people, such as 1h 5m or 1 hour, 5 minutes, in the language of the user or server it is for.

  • permissionNames

    The permissions as a server owner reads them in Discord's role settings, such as Ban Members for BanMembers, in the language of the user or server they are for.

  • translateError

    The text MeoCord's fallback answers an error with, in a user's or a server's language.

  • Translator

    Translates messages from one catalog per locale, typed by the default one.

Pipeline stages

  • OwnerGuard

    Lets 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.

  • Faces
  • GuildNavigationMentions
  • HeadingLevel
  • TimestampStyles
  • applicationDirectory
  • blockQuote
  • bold
  • channelLink
  • channelMention
  • chatInputApplicationCommandMention
  • codeBlock
  • email
  • escapeBold
  • escapeBulletedList
  • escapeCodeBlock
  • escapeEscape
  • escapeHeading
  • escapeInlineCode
  • escapeItalic
  • escapeMarkdown
  • escapeMaskedLink
  • escapeNumberedList
  • escapeSpoiler
  • escapeStrikethrough
  • escapeUnderline
  • formatEmoji
  • heading
  • hideLinkEmbed
  • hyperlink
  • inlineCode
  • italic
  • linkedRoleMention
  • messageLink
  • orderedList
  • phoneNumber
  • quote
  • roleMention
  • spoiler
  • strikethrough
  • subtext
  • time
  • underline
  • unorderedList
  • userMention
  • type EscapeMarkdownOptions
  • type FormatEmojiOptions
  • type RecursiveArray
  • type TimestampStylesString