Skip to content
Docs

Chat apps

Chat apps, in the Services group, lists every bot your workspace has on a chat app, whatever carries its messages. New bot adds one, and a row opens the bot’s own page, where you manage it.

A bot reaches Publicus in one of two ways, and the list says which under How it connects:

  • Dials out: Publicus opens a connection to the chat app’s own real-time gateway and keeps it open, so the bot needs no public address. Discord bots (through the bot gateway) and Slack bots (through Socket Mode) made with New bot connect this way, and most of this page is about them.
  • Webhook: the chat app sends each message to the address of a webhook with that chat app’s handler. Telegram, Teams and WhatsApp bots connect this way, and so do Slack or Discord bots that receive over HTTP. Their page is the webhook’s.

For the end-to-end setup of a chat agent, see Connect a Slack agent and Connect a Discord agent. For how the two ways compare, see Conversational channels.

The Chat apps list with New bot, and each bot's name, platform, how it connects, Dials out or Webhook, and when it was created
The Chat apps list with New bot, and each bot's name, platform, how it connects, Dials out or Webhook, and when it was created
Column Shows
Name The name you gave the bot. Searchable.
Platform The chat app: Discord, Slack, Teams, Telegram or WhatsApp.
How it connects Dials out or Webhook, as above.
Created How long ago the bot was added.

Filter the list by Platform or by How it connects. New bot opens a menu with one bot per chat app: Discord bot and Slack bot open the form below, and Telegram bot, Teams bot and WhatsApp bot open a new webhook with that chat app’s handler already chosen.

The Chat apps list shows no status. Whether a Discord or Slack bot works is on its page and in the Bots list, which holds only the bots Publicus dials out for. The Bots link at the top of such a bot’s page opens it, and so does a Home chip such as 2 bots failing.

The Bots list of Discord and Slack bots with the Live and Silent views, and each bot's status reading Working, Failing or Off with the reason under it, beside its Receive from this channel action
The Bots list of Discord and Slack bots with the Live and Silent views, and each bot's status reading Working, Failing or Off with the reason under it, beside its Receive from this channel action
Column Shows
Name The name you gave the bot. Searchable.
Channel The platform: discord or slack.
Conversation The conversation mode, per_turn or durable_workflow.
Frames How many inbound frames the bot has received and kept.
Status Whether the bot works, in a word, with the reason under it. See below.
Created at When it was created. Hidden until toggled on.
Updated at When it last changed. Hidden until toggled on.

The same word appears on the row, at the top of the bot’s page, and in search.

  • Failing (red): the gateway gave up on the connection, and the line under it gives the reason the platform gave, such as a token Slack refused. Fix what it says, then save the bot to open its connection again. A bot whose connection the gateway has not opened within five minutes of being switched on is Failing too.
  • Off (gray): the bot is switched off, so it hears nothing.
  • Connecting (gray): the bot was just saved or switched on, and the gateway is opening its connection.
  • Working (green): the gateway holds the connection open and a message arrived in the last 14 days. The line under it says when the last one came.
  • Quiet (gray): the gateway holds the connection open, and no message has arrived for 14 days, or none yet. Nothing has gone wrong that Publicus can see, but nothing has confirmed the bot hears anything either. Check the bot on its page asks the platform.

A deleted bot reads Archived.

Two preset views split the list:

  • Live shows active bots.
  • Silent shows switched-off ones. A switched-off bot is the difference between a bot that answers and one that says nothing, and nothing else on the page states that at a glance.

Each row offers Receive from this channel: it adds a Gateway trigger node, already bound to this bot, to a flow you pick or to a new flow you name in the same modal.

The Use in a flow modal: a Flow picker set to Create a new flow, a New flow name field, and Add to flow
The Use in a flow modal: a Flow picker set to Create a new flow, a New flow name field, and Add to flow

Under Chat apps, New bot and then Discord bot or Slack bot opens a single form:

Field Required Notes
Name Yes A descriptive name for the bot.
Channel Yes Discord or Slack.
Bot token secret No The secret holding the bot token. Create one inline with the + button. The token never leaves the secret store. The form saves without one, but the connection cannot open until it is set.
Slack app-level token secret Slack only The secret holding the app-level token (starts with xapp-) used to open the Socket Mode connection. Slack needs both tokens; Discord needs only the bot token.
Only in these servers (Discord) or Only in these workspaces (Slack) No Server or workspace ids, separated by commas. To pick them by name instead, use Check the bot. A message from anywhere else is ignored before it starts anything, and in Discord so is a direct message. Anyone with a public bot’s invite link can add it to their own server; this keeps their messages from starting your flows. A Slack app installed in one workspace hears no other, so on Slack this matters once you distribute the app.
Only in these channels No Channel ids, separated by commas, or picked by name in Check the bot. A message in any other channel, or a direct message, is ignored before it starts anything and leaves no receipt. A message in a thread counts as its channel. Leave it empty for every channel the bot can read.
May send direct messages to No User ids, separated by commas. A Discord or Slack node sending as this bot may message these people directly, besides the person whose message started the run, who it can always answer. Leave it empty and a flow cannot message anyone first.
Conversation mode Yes Per turn, a fresh run for each message. The default. Durable workflow, a suspendable conversation.
Endpoint override No Reserved for a nonstandard gateway URL; leave it blank. The connection dials each platform’s own gateway.
Options No Channel-specific key-value options, such as Discord intents.
Active When on, Publicus opens and maintains the connection.
Chat app What the bot does around an agent’s answer: reply in the chat, show its progress, show typing (Discord), approvals in the chat, reactions as feedback, and answer in a thread. Who answers forms sets who may answer a form the agent asks for: whoever presses Fill in the form (the default), anyone in the chat, or workspace members only. An Agent node can change each option for itself, except that approvals switched off here stay off.
The Create bot form: Name, Channel, Bot token secret, Only in these channels, Conversation mode, Endpoint override, Options, Active, and the Chat app section with its toggles and Who answers forms
The Create bot form: Name, Channel, Bot token secret, Only in these channels, Conversation mode, Endpoint override, Options, Active, and the Chat app section with its toggles and Who answers forms

Saving the form takes effect immediately, with no publish or deploy step. Turning Active on tells Publicus to open the connection; it then keeps the socket alive, reconnecting automatically when the platform drops it. Turning Active off closes it. Deleting the bot closes it as well. When the platform refuses the connection itself, for a bad token or an intent the bot is not allowed, Publicus stops retrying; fix what was wrong and save the bot, which opens its connection again.

A Slack bot's page reading Failing under its name, and below it a red line saying the bot hears nothing because the gateway gave up 3 hours ago when the app-level token was revoked
A Slack bot's page reading Failing under its name, and below it a red line saying the bot hears nothing because the gateway gave up 3 hours ago when the app-level token was revoked

The proof that a connection is receiving is its Received frames tab, described below. Bot-authored messages are ignored on both platforms, so the bot cannot trigger itself into a reply loop.

The heading of a Discord or Slack bot’s page gives its status and why: when the last message came, that the gateway is still opening it, or why the gateway gave up.

A Discord bot's page heading reading Working, the last message 20 minutes ago, with Check the bot and Delete
A Discord bot's page heading reading Working, the last message 20 minutes ago, with Check the bot and Delete

Check the bot, at the top of the page, is the bot’s setup. You can create a bot with only its name and channel, then do the rest there:

  • The tokens: paste the bot token, and for Slack the app-level token too. Publicus checks each with the chat app before keeping it in your workspace’s secrets, and switches the connection on once it has what it needs. For Slack, Create the Slack app opens Slack with the app’s settings already filled in.
  • Discord’s Message Content Intent: Publicus turns it on with the bot token. Discord allows that for a bot in fewer than 100 servers; for a larger one, the check links to the page where you turn it on.
  • The invite: for Discord, Invite the bot to a server asks for exactly what an agent’s answer needs.
  • Where it listens: pick servers and channels from the ones the bot can see. A Slack app joins a public channel you pick by itself.
Check the bot for a Discord bot: every check passing, from the bot token and Message Content intent to the gateway, and Where it listens with a server and a channel picked
Check the bot for a Discord bot: every check passing, from the bot token and Message Content intent to the gateway, and Where it listens with a server and a channel picked

Below them it lists each check the chat app answers, with what to fix and where:

  • Discord: whether the bot token works, whether the Message Content Intent is on, which servers the bot is in, and whether it can see each channel it listens in.
  • Slack: whether the app-level token opens Socket Mode, whether the bot token works, whether the bot may post (chat:write) and read messages, and whether it is in each channel it listens in.
  • Both: whether the gateway holds the connection open.
Check the bot for a Slack bot: steps to create the Slack app and paste the app-level token, then the checks, with the app token and the gateway failing and saying what to fix
Check the bot for a Slack bot: steps to create the Slack app and paste the app-level token, then the checks, with the app token and the gateway failing and saying what to fix

While something fails, the setup asks the chat app again every few seconds, so a bot you invite in another tab shows up by itself. A question mark is a check the chat app did not answer just now.

When you build with the AI builder, it opens the same setup as a card in the chat, and carries on once the bot is ready.

The bot setup as a card in the builder chat: steps to create the Discord application and paste the bot token, the failing bot token check with what to fix, the passing checks, and Continue anyway and Check again
The bot setup as a card in the builder chat: steps to create the Discord application and paste the bot token, the failing bot token check with what to fix, the passing checks, and Continue anyway and Check again

A Discord or Slack bot starts flows through the Gateway trigger node. Add one to a flow (the row action above does this for you), bind it to the bot, and arm it on the canvas; see Triggers & arming. One bot fans out to every flow with an armed Gateway node bound to it, and each inbound message starts a fresh run of each. A bot on a webhook starts flows through a Webhook trigger node bound to its webhook instead; see Webhooks.

Inside the flow, the message arrives as the start data: $start->text carries the message text, with the conversation and user identifiers beside it as $start->externalConversationId and $start->externalUserId, and $start->conversationKey to key a conversation’s memory by. When the flow has an Agent, the bot posts its answer in the conversation the message came from, as the Chat app options say, so the flow needs no send node for the reply. A Channel send node after the agent turns that reply off, so nothing is posted twice.

The Chat app section: Reply in the chat, Show typing, Reactions as feedback and Answer in a thread on, Show progress and Approvals in the chat off, Who answers forms set to Whoever presses, and the Voice messages note
The Chat app section: Reply in the chat, Show typing, Reactions as feedback and Answer in a thread on, Show progress and Approvals in the chat off, Who answers forms set to Whoever presses, and the Voice messages note

Open a Discord or Slack bot to see the Received frames tab: a durable receipt for every inbound frame, written before any flow is started, so a frame that matched nothing still leaves a row.

The Received frames tab: each frame's time, channel, outcome, whether it was skipped and how many runs it started, some of them zero, with View and a ⋮ row menu
The Received frames tab: each frame's time, channel, outcome, whether it was skipped and how many runs it started, some of them zero, with View and a ⋮ row menu
Column Shows
When Timestamp of the frame.
Channel The platform it arrived on.
Outcome succeeded, or upstream_error when handling raised an exception.
Skipped Whether a bound flow was skipped, and the receipt records why: an overlapping run already in progress, or a trigger that is not wired into Start. A skipped frame otherwise looks identical to one that matched nothing.
Runs How many runs the frame started. Grey zero means it started none.

Each row can be opened to inspect the frame’s payload. Re-trigger dispatches a stored frame again exactly as it arrived, against either the published flow version or the draft you are editing. Any run it starts repeats its side effects for real, and the action is unavailable once the stored payload passes its retention window.

A received Discord frame opened: its origin, channel and JSON payload with the message text, user, workspace and conversation ids
A received Discord frame opened: its origin, channel and JSON payload with the message text, user, workspace and conversation ids