Skip to main content

Delete Command

Deletes a registered Discord slash command.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - The Discord bot client identifier from the Connect node (optional if Bot Token provided).
  • Application Id - The Discord application ID.
  • Command Id - The ID of the command to delete (obtained from List Commands).

Options

  • Bot Token - Discord bot token credential (optional if using Client ID from Connect node).
  • Server Id - (Optional) Server (guild) ID if deleting a server-specific command.

How It Works

The Delete Command node removes a slash command registration. When executed, the node:

  1. Authenticates using either Client ID or direct bot token
  2. Validates the application ID and command ID
  3. Sends a delete command request to Discord API
  4. Removes the command (globally or from the specified server)

Requirements

  • Active Discord bot session (Client ID) or bot token credentials
  • Valid application ID and command ID
  • applications.commands scope enabled

Error Handling

The node will return specific errors in the following cases:

  • ErrInvalidArg - Client ID or bot token missing/invalid
  • ErrInvalidArg - Application ID is empty
  • ErrInvalidArg - Command ID is empty
  • ErrInternal - Error deleting the command

Getting Command IDs

Use the List Commands node to get command IDs:

1. List Commands → cmds
2. For each command:
- If command.Name == "old-command":
- Delete Command
- Command Id: {{command.ID}}

Example: Delete Specific Command

Inputs:

  • Application Id: "123456789012345678"
  • Command Id: "555555555555555555"

Result: The command is permanently deleted.

Example: Cleanup Old Commands

Flow:

1. List Commands → cmds
2. Define old_commands = ["test", "debug", "temp"]
3. For each command in cmds:
- Condition: command.Name in old_commands
- If True:
- Delete Command
- Command Id: {{command.ID}}

Result: Automatically clean up multiple old commands.

Example: Delete All Server Commands

Flow:

1. List Commands
- Server Id: "987654321098765432"
- → server_cmds
2. For each command in server_cmds:
- Delete Command
- Application Id: {{command.ApplicationID}}
- Command Id: {{command.ID}}
- Server Id: "987654321098765432"

Result: Remove all commands from a specific server.

Example: Command Replacement

Flow:

1. List Commands → cmds
2. Find command with Name == "help"
3. Delete Command (old help command)
4. Create Command (new help command with updated features)

Result: Replace an existing command with a new version.

Use Cases

  • Command cleanup - Remove outdated or unused commands
  • Testing - Delete test commands after development
  • Rebranding - Remove old command names
  • Error correction - Delete incorrectly configured commands
  • Reorganization - Clear all commands before restructuring
  • Limit management - Stay within the 100 command limit

Global vs Server Commands

Delete Global Command:

  • Leave Server Id empty
  • Removes command from all servers

Delete Server Command:

  • Provide Server Id
  • Removes command only from that server

Command Deletion Behavior

When a command is deleted:

  • Users can no longer invoke it
  • Deletion is immediate for server commands
  • Global command deletion may take up to 1 hour to propagate
  • Existing interactions may still complete if already started
  • Command ID becomes invalid

Tips and Best Practices

  • List before delete - Always list commands first to get correct IDs
  • Confirm deletion - Double-check command ID before deleting
  • Batch operations - Delete multiple commands efficiently
  • Global caution - Be careful when deleting global commands (affects all servers)
  • Testing - Test deletions with server commands first
  • Documentation - Keep records of deleted commands
  • Recreate carefully - Deleted commands can be recreated but will have new IDs