Skip to Content
nyx logonyx guide

Command Internals

Reading time:3 min read

The commands system is made up of several components that work together to store, resolve, execute commands and more.

Command system components

Specifically, these components are:

Execution Sequence

The following diagrams show the flow of a command execution. You can check the guide of each component to see exactly how it works, or how to replace it.

Diagram usage

  • You can zoom and drag on the diagrams.
  • A dashed step means it's executed through a non awaited (but caught) Promise, so the next one is inmediately executed if there's an I/O operation in the step.
  • You can hover over steps with (?) to see extra details.
  • If a step goes to a target, and that target doesn't continue the flow, then it's an immediate return, like a getter call.

Command event

For a command to be executed, you first receive a interactionCreate event, which is then passed to the CommandManager:

Loading…

Command resolution

The CommandResolver then resolves the command that the interaction refers to. For component interactions, this first needs an intermediate step through the CommandCustomIdCodec to deserialize the customId.

Command Interactions

Loading…

Component Interactions

Loading…

Command execution

Once the command is resolved, it's passed to the CommandExecutor:

Loading…

On which the execution ends.

Next, see the documentation of each component, where you'll find what it does and how to replace it.

Edit on GitHub

Last updated on

On this page