Piecewise

Build chat bots with blocks

🗣️ when (type) with name (name) description (description) in server (guild) with options (args) do (do)

In Discord → Interactions → Application Commands

Jump to block

Create a slash command.

Requires the following blocks to be present in the project: discord login

Parameters

Parameter name Parameter type Required? Description
type any The type of command to create.
name String The name of the slash command.
description String The description of this slash command.
guild guild The server to create the command in. If this is omitted, it will be created as a “global” command. Global commands may not appear in search for up to an hour.
args command_arg OR Array A list of options (or a singular option) to accept with this slash command.
do statements… What to do when this slash command is called. You must respond to this interaction - or defer a response if you expect it to take longer than three seconds to execute.

Output

void - This is a statement with no outputs