discord / trigger / schema v1
Discord: Slash Command
Trigger when a slash command is used: define options to pass arguments (user, text, number…)
Prerequisites
- Add the discord plugin inside this workflow.
- Connect and authorize a discord account before running this node.
Parameters
| Parameter | Type | Description |
|---|---|---|
ServerguildId | discord_guild Required | The server where the slash command is registered. It appears in Discord’s command list a few minutes after you activate the workflow. |
Command Namecommand | text Required | The name users type after "/": lowercase, no spaces. Registered on your server when the workflow is activated. |
Command Descriptiondescription | text Optional | Shown in Discord’s command picker under the command name. Helps your members understand what it does. |
Who can use this command?accessMode | select Optional Default: | Recommended protection reads the actions this command can reach. For example, a Ban action requires the caller to have Discord’s Ban Members permission. Ordinary commands stay open. Existing workflows keep their previous role-filter behaviour until you choose a mode. Options: Recommended protection (recommended), Selected roles (roles), Everyone (everyone) |
Command Options (arguments)commandOptions | command_options Optional | Arguments users fill in when running the command (a user, some text, a number…). Each one becomes a variable: an option named "target" is available as {{option_target}}. |
Allowed RolesroleFilter | discord_role Optional | With Selected roles, pick who may run the command. With Recommended protection, this is an optional extra restriction. Existing workflows that already use this field keep exactly the same behaviour. |
Channel FilterchannelFilter | discord_channel Optional | Optional. Empty = the command works in every channel. Pick channels to only allow it there. |
Inputs and outputs
Inputs
No ports declared.
Outputs
on_slash_command- On Command (output)interaction_id- Interaction ID (output)command_name- Command Name (output)user_id- User ID (caller) (output)username- Username (caller) (output)user_avatar- Avatar URL (caller) (output)channel_id- Channel ID (output)guild_id- Server ID (output)member_roles- Caller role IDs (output)member_permissions- Caller permissions (output)interaction_token- Reply pass (output)timestamp- Timestamp (output)
Output data schema
[
{
"key": "interaction_id",
"type": "snowflake",
"label": "Interaction ID",
"bindingRole": "current_context"
},
{
"key": "command_name",
"type": "string",
"label": "Command Name"
},
{
"key": "user_id",
"type": "user",
"label": "User ID (caller)",
"bindingRole": "actor"
},
{
"key": "username",
"type": "string",
"label": "Username (caller)",
"bindingRole": "actor"
},
{
"key": "user_avatar",
"type": "url",
"label": "Avatar URL (caller)"
},
{
"key": "channel_id",
"type": "channel",
"label": "Channel ID",
"bindingRole": "current_context"
},
{
"key": "guild_id",
"type": "guild",
"label": "Server ID",
"bindingRole": "current_context"
},
{
"key": "member_roles",
"type": "array",
"label": "Caller role IDs",
"items": {
"key": "role_id",
"type": "snowflake",
"bindingRole": "actor"
},
"bindingRole": "actor"
},
{
"key": "member_permissions",
"type": "array",
"label": "Caller permissions",
"description": "Discord permission names the caller has in this server (e.g. BanMembers).",
"items": {
"key": "permission",
"type": "string",
"bindingRole": "actor"
},
"bindingRole": "actor"
},
{
"key": "interaction_token",
"type": "string",
"label": "Reply pass",
"description": "Used automatically when you reply to this. You normally never need to insert it yourself.",
"bindingRole": "current_context"
},
{
"key": "timestamp",
"type": "timestamp",
"label": "Timestamp"
}
]Examples and troubleshooting have not yet been reviewed for this contract.
Version and compatibility
This reference follows the current authoring contract. Existing workflows retain their saved node revisions.
Contract identifier
a7f630ce0ab01444e5400c0e8d1b155ddd2dc67892330724183e3e8410f2877a