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.

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

  • ThemeCache

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

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.

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