Block reference / Online services

Discord

Post a message, a picture or both to a Discord channel through its webhook.

In both appsWarpX BrowserWarpX Phone

Use Discord to post what a workflow did into a channel your team reads: a finished run, a failed account, a screenshot of what went wrong. It posts through a channel webhook, so there is no bot to create and nothing to sign in to — the webhook address is the whole permission. It can attach a picture, such as the one Take screenshot saved in a variable.

The Discord block's settings, filled in as in the example below.

Settings

Webhook address

The channel's webhook, shaped like https://discord.com/api/webhooks/1290…/Xk2…. In Discord: the channel's settings, Integrations, Webhooks, New Webhook, Copy Webhook URL. Anyone with the address can post there, so keep it in Databases → Credentials.

Example{{secrets.discordHook}}
Message

The text to post, with references filled in. Discord's own markdown works, such as **bold** and _italic_. It can be empty when you post a picture.

Example**{{variables.profileName}}** finished: {{variables.ordersPlaced}} orders placed
Send as

The name the post shows. Empty uses the webhook's own name, set when you created it.

ExampleWarpX runner
Picture

Optional. The name of a variable holding a screenshot, which is what Take screenshot saves; a path to an image on this computer; or an image address starting https://. A screenshot or a file is attached to the post; an address is shown as an embedded image.

ExampledoneShot

Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.

What it hands on

Hands nothing on. The log line reads Sent to Discord, and the block leaves by its single output. When Discord refuses, the block fails with its reason, such as Discord answered 404: Unknown Webhook for a deleted webhook.

Example: Post each profile's result to a channel

  1. Start
  2. Open URL
  3. Get text
  4. Take screenshot
  5. Discord
Where Discord sits in the example workflow.
  1. In Discord, open the channel's settings, Integrations, Webhooks, New Webhook, name it WarpX, and press Copy Webhook URL.
  2. Save the address in Databases → Credentials as discordHook.
  3. At the end of the workflow, read the number of orders with Get text into ordersPlaced, then add Take screenshot of the order history page with Assign to variable ticked and the variable named doneShot.
  4. Add Discord. Set Webhook address to {{secrets.discordHook}} and the message to **{{variables.profileName}}** finished: {{variables.ordersPlaced}} orders placed.
  5. Set Send as to WarpX runner and Picture to doneShot.
  6. Run it. The channel gets one post per profile with the screenshot attached.

On WarpX Phone

  • On WarpX Phone, take the picture with the phone's Screenshot block with Assign to variable ticked, and type that variable's name in Picture. It holds the saved file's path, which is attached to the post.

Good to know

  • Only a Discord webhook is accepted: an https:// address on discord.com (or discordapp.com, ptb.discord.com, canary.discord.com). Anything else fails before sending, with The webhook address must be a https://discord.com/api/webhooks/… link.
  • Discord takes 2000 characters per message. A longer message is cut at 2000, not split; send a long report as two blocks or shorten it.
  • A path on this computer needs the WarpX Browser desktop app. An image address is fetched by Discord, so it must be public.
  • The post goes from this computer to Discord, not through the profile's browser or its proxy.

See also

  • Telegram — Send a message, a picture or both to a Telegram chat, group or channel with your own bot.
  • Google Chat — Post a text message to a Google Chat space through its webhook, optionally into a thread.
  • Take screenshot — Captures the visible page, the whole page or one element as an image, and saves it as a file, in the table or in a variable.