Discord Bot icon

Discord Bot

Send messages and manage slash commands for Discord bots

Send Message

AI-generated

Summary

Send a message to a specified Discord channel or direct message a user with customizable content, embeds, buttons, select menus, and other rich message components.

Inputs

  • Target Type (required) — Choose whether to send the message to a channel or as a direct message to a user.
  • Guild Names or IDs — Select one or more guilds by name or ID to filter available channels when targeting a channel. Used only when Target Type is 'Channel'.
  • Channel Name or ID (required) — Specify the channel name or ID within the selected guilds to send the message to. Required when Target Type is 'Channel'.
  • User ID (required) — Specify the user ID to send a direct message to. Required when Target Type is 'User DM'.
  • Content — Plain text content of the message.
  • Message Payload Mode (required) — Choose how to provide message payload details: 'Builder' for visual UI builders, 'Raw JSON' to directly specify the Discord API JSON arrays for embeds and components, or 'Builder + Advanced JSON Merge' to combine both.
  • Embeds — Use the visual embed builder to create up to 10 embeds with titles, descriptions, fields, images, colors, footers, and timestamps when using Builder or Builder + Advanced JSON Merge modes.
  • Buttons — Add up to 25 buttons organized into rows, with custom IDs or URLs, including styles and emojis, when using Builder or Builder + Advanced JSON Merge modes.
  • String Select Menus — Add custom dropdown select menus with options and custom IDs for user selection interaction, when using Builder or Builder + Advanced JSON Merge.
  • Auto-Populated Select Menus — Add dropdown menus auto-populated by Discord with server members, roles, channels, or mentionables, each with a custom ID.
  • Text Displays — Add top-level markdown-formatted text display blocks incompatible with embeds in the same message.
  • Sections — Add top-level section blocks with title, content, and optional thumbnail image; cannot coexist with embeds.
  • Separators — Add horizontal or emoji separators as layout elements; cannot be used with embeds.
  • Containers — Add top-level container blocks with optional accent color and content; cannot be used with embeds.
  • Media Galleries — Add gallery blocks containing up to 10 images; cannot be used alongside embeds.
  • Files — Attach files by URL with optional display names; cannot be combined with embeds.
  • Embeds JSON — Provide raw JSON array of Discord embed objects when Message Payload Mode includes raw JSON.
  • Components JSON — Provide raw JSON array of Discord components (buttons, selects, modals) when Message Payload Mode includes raw JSON.

Output shape

a single message object representing the sent Discord message

The message object includes IDs and metadata for the sent message. The operation may throw errors if required inputs are missing or if payload limits are violated. Up to 10 embeds and 5 action rows of components are supported per message, per Discord API limits.

Examples

Example 1: Send a simple text message to a specific channel

Set Target Type to 'Channel', select the guild(s), choose the channel, and provide the message Content.

Example 2: Send a direct message to a user with buttons

Set Target Type to 'User DM', specify the User ID, choose Payload Mode 'Builder', add content, and add buttons via the Button Builder.

Links

Discussion