Skip to content
GitHub

CommandRegistrationConfig

interface in meocord/interface Since 4.1.0

interface CommandRegistrationConfig

Where and whether MeoCord registers the application's commands with Discord, set as meocord.config.ts's commands.

Global commands can take a while to show up in clients; guild commands appear at once, which is what a development guild is for. Set register: false to register only with meocord register, from CI for instance.

Examples

TypeScript
export default {
  discordToken: process.env.DISCORD_TOKEN!,
  // Every command goes to this guild under `meocord start --dev`, and globally in production
  commands: { developmentGuild: process.env.DEV_GUILD_ID || undefined },
} satisfies MeoCordConfig

Members

guilds

guilds?: (string | undefined)[]

Guilds to register every command to instead of globally. Unset or empty registers globally. Blank ids are dropped; a list with none left, as [process.env.GUILD_ID] leaves it with the variable unset, registers those commands nowhere, with a warning, rather than globally. A builder's own guilds option takes precedence for its command.

developmentGuild

developmentGuild?: string

A guild that receives every command, and nothing else does, while NODE_ENV is development — as under meocord start --dev. Ignored in production.

register

register?: boolean

Whether the bot registers its commands when it starts. Set false to register only with meocord register, from CI for instance.

Default: true

clearOther

clearOther?: boolean

Whether to remove this application's commands from the scopes this configuration names but is not registering to, such as the global commands left behind after moving to guilds. Without it, such leftovers are reported as a warning. While developmentGuild receives every command, as under start --dev, leftovers are only warned about, since a production bot sharing the application may own them; production starts and meocord register without --dev remove them.

Default: false

See also

  • Slash commands