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":"..."}ondiscord/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 HubGET SECRET/GET ENV. -
Correct API base:
BASE_ADDRESSishttps://discord.com/api/v10with 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
-
Replace the two placeholders in the action cells.
-
Deploy the route, then the actions.
