Skip to content

Discord ​

Posts a message, with or without attachments, to a Discord channel, or starts a thread there — through your bot.

The Discord node posts to a server’s channel through your bot: an alert when an urgent email arrives, a summary, an email’s attachments. It can also start a public thread and post its first message.

By default mentions are disabled: an @everyone inside text coming from an email notifies nobody. Tick Allow mentions to let them work.

It works with a Discord connection. See Discord.

At a glance ​

  • Type: discord.api · version 1
  • Category: Data
  • Kind: Step — one stage of a run
  • Effect: Writes outside (external_write) — writes outside Loop & Roll; described instead of performed during a test run
  • Needs a carrier email: No
  • Connection: Discord
  • Inputs: main
  • Outputs: main
The ports of “Discord”: what comes in on the left, what goes out on the rightInput: main. Outputs: main. An error output appears when its failure setting is “Follow the Error output”. It needs a Discord connection.Discorddiscord.apimainmainerror · only with “Follow the Error output”Connection: Discord
The ports of “Discord”: what comes in on the left, what goes out on the right

Connection ​

This node needs a Discord connection.

Parameters ​

connection ​

Discord connection — The Discord connection to use. Create it once in Connections; its key never appears in the workflow.

  • Type: Connection (credential)
  • Required: Yes
  • Default: "" (empty)

action ​

Action

  • Type: One choice (options)
  • Required: Yes
  • Default: send
  • Options:
    • send — Post a message
    • startThread — Start a thread: A public thread in the channel, and its first message.

guild ​

Server

  • Type: Remote resource (resourceLocator)
  • Required: Yes
  • Ways to choose: pick from a list, type an ID (discord.guild)
  • Listed with the connection in: connection

channel ​

Channel — An existing thread is designated by its id (“ID” mode).

  • Type: Remote resource (resourceLocator)
  • Required: Yes
  • Ways to choose: pick from a list, type an ID (discord.channel)
  • Listed inside: guild
  • Listed with the connection in: connection

threadName ​

Thread name

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 100 characters at most
  • Example: {{ email.subject }}
  • Shown when: action is startThread
  • Expressions: {{ }} accepted

content ​

Message — Discord Markdown, 2,000 characters at most (beyond that, the text is cut). Accepts {{ }} expressions.

  • Type: Long text (text)
  • Required: Yes
  • Default: "" (empty)
  • 4000 characters at most
  • Expressions: {{ }} accepted

allowMentions ​

Allow mentions — Off: @everyone, @here or @name in the text notify nobody.

  • Type: Yes / no (boolean)
  • Required: No
  • Default: false

withAttachments ​

Attach files — The email’s attachments or those added by an earlier step (ten at most, 25 MB in total).

  • Type: Yes / no (boolean)
  • Required: No
  • Default: false
  • Shown when: action is send

selection ​

Attachments to use

  • Type: One choice (options)
  • Required: Yes
  • Default: all
  • Options:
    • all — All attachments: Those of the triggering email, then the files added by earlier steps (a fetched deed, a signed PDF), in that order.
    • first — The first one only: The first attachment, when only one matters.
    • byMime — By file type: By MIME type: application/pdf, or a whole family with image/*.
    • byName — By file name: By name pattern: *.pdf, invoice-*.
  • Shown when: action is send and withAttachments is true

mime ​

File type — Exact MIME type (application/pdf) or a whole family (image/*). Left empty, no attachment is kept.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: application/pdf
  • Shown when: action is send and withAttachments is true and selection is byMime
  • Expressions: {{ }} accepted

namePattern ​

File name — Simple pattern: * matches anything, ? one character (*.pdf, invoice-*). Case is ignored.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: *.pdf
  • Shown when: action is send and withAttachments is true and selection is byName
  • Expressions: {{ }} accepted

Outputs ​

  • main — Taken once the post succeeds. An error answer from Discord (bot missing, permission missing) fails the step instead.

Data produced ​

What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).

  • {{ data.<step>.messageId }} — string. The id of the message posted.
  • {{ data.<step>.threadId }} — string. Start a thread only: the thread id, usable as a channel by a later step.
  • {{ data.<step>.attachmentCount }} — number. Post a message only: how many files were attached.
  • {{ data.<step>.truncated }} — boolean. true when the text was cut at 2,000 characters.
  • {{ data.<step>.simulated }} — boolean. true when the post was described instead of done (test run).
  • {{ data.<step>.summary }} — string. The one-line summary in the member’s language.

Loop & Roll — the workflow builder for email.