Skip to content
Entity Info commandEventMode

$commandEventMode

The $commandEventMode function returns the way the command is built (workflow, bdfd_script or javascript) that triggered the current event workflow.

Syntax

$commandEventMode

Parameters

None (passing one is an error).

Return value

  • Type: String
  • Example: bdfd_script.
  • Outside a Command Created, Command Updated or Command Deleted event, the error Invocation metadata commandEvent.executionMode is unavailable. is raised.

Behavior

  • These events are not Discord events: they fire when a command of the bot is created, edited or deleted in Bot Creator (editor, Studio, Copilot or MCP). Saving a command without changing it fires nothing.
  • There is no server, channel or user in these events: pass the channel ID explicitly to $sendMessage.

Examples

$channelSendMessage[123456789012345678;Command updated: $commandEventName ($commandEventID)]

Notes

  • Add the workflow in Workflows → Event → Commands → Command Created / Command Updated / Command Deleted.

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.