discord / trigger / schema v1
Discord: Message
Trigger when a message is sent in a Discord channel
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 Discord server this trigger watches. Your bot must be a member of it. The list comes from your connected bot. |
Channel FilterchannelId | discord_channel Optional | Optional. Leave empty and the trigger fires for messages in EVERY channel the bot can see on this server. Pick one or more channels to only listen there. |
Role FilterroleFilter | discord_role Optional | Optional. Only messages from members who have at least one of these roles fire the trigger. Empty = everyone. |
Prefix Filterprefix | tags Optional | Optional. Only messages STARTING with one of these fire the trigger. E.g. "!help" for a classic chat command. Empty = every message triggers. |
Keyword Filterkeyword | tags Optional | Optional. Only messages CONTAINING one of these words fire the trigger, anywhere in the text. Empty = no keyword filtering. |
From UserfromUserId | discord_user Optional | Optional. Only messages sent by these specific users fire the trigger. Empty = messages from anyone. |
Ignore BotsignoreBots | boolean Optional | Skips messages sent by bots, including your own. Strongly recommended: a bot that answers bots can end up replying to itself in an endless loop. |
Inputs and outputs
Inputs
No ports declared.
Outputs
on_message- On Message (output)message_id- Message ID (output)content- Content (output)author_id- Author ID (output)author_username- Author Username (output)author_display_name- Author Display Name (output)author_avatar- Author Avatar (output)is_bot- Author Is Bot (output)channel_id- Channel ID (output)channel_name- Channel Name (output)guild_id- Server ID (output)timestamp- Timestamp (output)jump_url- Jump URL (output)attachment_count- Attachments (output)attachments- Attachment Files (output)ref_message_id- Reply-to ID (output)mentions- Mentioned Users (output)mention_roles- Mentioned Roles (output)member_roles- Author role IDs (output)command- Command (output)arg_1- Arg 1 (output)arg_2- Arg 2 (output)arg_3- Arg 3 (output)args_text- Text after the command (output)args_text_no_mentions- Text after the command (mentions as IDs) (output)first_mention_id- 1st Mentioned User ID (output)first_mention_username- 1st Mentioned Username (output)second_mention_id- 2nd Mentioned User ID (output)second_mention_username- 2nd Mentioned Username (output)first_role_id- 1st Mentioned Role ID (output)first_role_name- 1st Mentioned Role Name (output)first_channel_mention- 1st Mentioned Channel ID (output)
Output data schema
[
{
"key": "message_id",
"type": "snowflake",
"label": "Message ID",
"bindingRole": "event_subject"
},
{
"key": "content",
"type": "string",
"label": "Content"
},
{
"key": "author_id",
"type": "user",
"label": "Author ID",
"bindingRole": "actor"
},
{
"key": "author_username",
"type": "string",
"label": "Author Username",
"bindingRole": "actor"
},
{
"key": "author_display_name",
"type": "string",
"label": "Author Display Name",
"description": "Server nickname if set, otherwise the username",
"bindingRole": "actor"
},
{
"key": "author_avatar",
"type": "url",
"label": "Author Avatar",
"bindingRole": "actor"
},
{
"key": "is_bot",
"type": "boolean",
"label": "Author Is Bot",
"bindingRole": "actor"
},
{
"key": "channel_id",
"type": "channel",
"label": "Channel ID",
"bindingRole": "current_context"
},
{
"key": "channel_name",
"type": "string",
"label": "Channel Name",
"bindingRole": "current_context"
},
{
"key": "guild_id",
"type": "guild",
"label": "Server ID",
"bindingRole": "current_context"
},
{
"key": "timestamp",
"type": "timestamp",
"label": "Timestamp"
},
{
"key": "jump_url",
"type": "url",
"label": "Jump URL"
},
{
"key": "attachment_count",
"type": "number",
"label": "Attachments"
},
{
"key": "attachments",
"type": "array",
"label": "Attachment Files",
"description": "id/url/name/size/content_type per attached file",
"items": {
"key": "attachment",
"type": "object",
"fields": [
{
"key": "id",
"type": "snowflake"
},
{
"key": "url",
"type": "url"
},
{
"key": "name",
"type": "string"
},
{
"key": "size",
"type": "number"
},
{
"key": "content_type",
"type": "string"
}
]
}
},
{
"key": "ref_message_id",
"type": "snowflake",
"label": "Reply-to ID",
"bindingRole": "selected_target"
},
{
"key": "mentions",
"type": "array",
"label": "Mentioned Users",
"items": {
"key": "mention",
"type": "object",
"fields": [
{
"key": "id",
"type": "user",
"bindingRole": "mentioned_subject"
},
{
"key": "username",
"type": "string",
"bindingRole": "mentioned_subject"
}
],
"bindingRole": "mentioned_subject"
},
"bindingRole": "mentioned_subject"
},
{
"key": "mention_roles",
"type": "array",
"label": "Mentioned Roles",
"items": {
"key": "mention_role",
"type": "object",
"fields": [
{
"key": "id",
"type": "role",
"bindingRole": "mentioned_subject"
},
{
"key": "name",
"type": "string",
"bindingRole": "mentioned_subject"
}
],
"bindingRole": "mentioned_subject"
},
"bindingRole": "mentioned_subject"
},
{
"key": "member_roles",
"type": "array",
"label": "Author role IDs",
"items": {
"key": "role_id",
"type": "snowflake",
"bindingRole": "actor"
},
"bindingRole": "actor"
},
{
"key": "command",
"type": "string",
"label": "Command",
"description": "First word of the message (e.g. \"!kick\")"
},
{
"key": "arg_1",
"type": "string",
"label": "Arg 1",
"description": "First argument: if a mention, resolves to the user/role/channel ID",
"bindingRole": "command_argument"
},
{
"key": "arg_2",
"type": "string",
"label": "Arg 2",
"description": "Second argument",
"bindingRole": "command_argument"
},
{
"key": "arg_3",
"type": "string",
"label": "Arg 3",
"description": "Third argument",
"bindingRole": "command_argument"
},
{
"key": "args_text",
"type": "string",
"label": "Text after the command",
"description": "Everything after the first word, as raw text",
"bindingRole": "command_argument"
},
{
"key": "args_text_no_mentions",
"type": "string",
"label": "Text after the command (mentions as IDs)",
"description": "The same text, with every @mention replaced by its plain ID",
"bindingRole": "command_argument"
},
{
"key": "first_mention_id",
"type": "user",
"label": "1st Mentioned User ID",
"bindingRole": "mentioned_subject"
},
{
"key": "first_mention_username",
"type": "string",
"label": "1st Mentioned Username",
"bindingRole": "mentioned_subject"
},
{
"key": "second_mention_id",
"type": "user",
"label": "2nd Mentioned User ID",
"bindingRole": "mentioned_subject"
},
{
"key": "second_mention_username",
"type": "string",
"label": "2nd Mentioned Username",
"bindingRole": "mentioned_subject"
},
{
"key": "first_role_id",
"type": "role",
"label": "1st Mentioned Role ID",
"bindingRole": "mentioned_subject"
},
{
"key": "first_role_name",
"type": "string",
"label": "1st Mentioned Role Name",
"bindingRole": "mentioned_subject"
},
{
"key": "first_channel_mention",
"type": "channel",
"label": "1st Mentioned Channel ID",
"bindingRole": "mentioned_subject"
}
]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
60a42816bc80a68af76680e0175faaf76fe0facd89a93c4c237ec28c9ef0ab6a