Coreflux Templates
General

Discord announcements from MQTT

Post text from an MQTT topic to a Discord channel via a REST_API route and a LoT action.

Dataflow

How it flows

Actions, models, routes and the topics that link them. Click a node to trace its flow.

How it works

 

Publish a string to discord/announce (or {"content":"..."} to discord/announce/json) and the broker posts it to a Discord channel through the Discord REST API v10. A small REST_API route owns the HTTPS call; the DiscordAnnounce action wraps your text with the bot token and channel id placeholders.

 

Key features

 

  • One MQTT topic → one Discord message: plain text on discord/announce.

  • Structured option: JSON {"content":"..."} on discord/announce/json.

  • Empty-message guard: blank payloads are skipped and reported on discord/announce/status.

  • Secrets out of git: replace <DISCORD_BOT_TOKEN> and <CHANNEL_ID>, or switch to Hub GET SECRET / GET ENV.

  • Correct API base: BASE_ADDRESS is https://discord.com/api/v10 with no trailing slash.

 

Prerequisites

 

  • Discord bot with Send Messages, invited to the server.

  • Coreflux broker licence that includes REST_API routes.

  • Outbound HTTPS to discord.com.

 

Setup

 

  1. Replace the two placeholders in the action cells.

  2. Deploy the route, then the actions.

The notebook

What’s inside

Browse the markdown and code cells before you download.

LoT Notebook:discord-announce.lotnb
Related use cases

Similar templates

Templates chosen for overlap in routes, tags, and category.

View all in General

Get this template

1 file