Skip to the page

Recipes

Discord recipes

Post incoming texts to a Discord channel.

Two recipes for Discord. Each names its trigger and the BlueBot step, lists the fields to map and says how to test it with your own number before anyone else gets a text.

How Discord connects

  • Zapier: BlueBot’s Zapier app has a Send Text action and instant triggers for incoming texts and every change of state.
  • API: Your own code calls BlueBot’s REST API and listens to its signed webhooks.

Post incoming texts to a channel

PartWhat it is
TriggerBlueBot’s New Incoming Text trigger in Zapier
ActionBlueBot’s New Incoming Text trigger starts it, and Discord takes the text
Connects throughZapier

Steps

  1. Start a Zap with BlueBot’s New Incoming Text trigger.
  2. Add Discord’s Send Channel Message action and pick the channel.
  3. Map the sender’s number and the words of the text into the message.

Map the fields

From BlueBotInto Discord
FromThe phone number to find the person by in Discord. It’s in E.164 (+15555550123); search by the last 10 digits if Discord stores numbers another way.
TextThe words, for a note, a row or a message. Null when the person sent only a picture.
Received AtWhen it came in, in UTC.
FilesPictures and voice memos. Each url works for an hour, so copy a file you want to keep.
Chat IDSet when the text came in a group chat; null for a one-to-one text.

Test it

Text your BlueBot number from another phone, one you’ve texted through BlueBot before, then press Test trigger in Zapier. It loads that text with its fields, ready to map. BlueBot copies texts from people you’ve texted through it, unless you set Which chats to copy to Everything.

Post replies with a channel webhook

PartWhat it is
TriggerA text comes in (BlueBot’s message.received webhook)
ActionA webhook for message.received starts it, and Discord takes the text
Connects throughAPI

Steps

  1. Create a webhook for the channel in Discord and copy its URL.
  2. Point a BlueBot webhook for message.received at a small function of your own.
  3. Have the function check BlueBot’s signature and post the sender and the words to the Discord webhook URL.

Map the fields

From BlueBotInto Discord
data.fromThe phone number to find the person by in Discord. It’s in E.164 (+15555550123); search by the last 10 digits if Discord stores numbers another way.
data.textThe words, for a note, a row or a message. Null when the person sent only a picture.
data.received_atWhen it came in, in UTC.
data.filesPictures and voice memos. Each url works for an hour, so copy a file you want to keep.
data.chat_idSet when the text came in a group chat; null for a one-to-one text.

Test it

Run bluebot listen --forward-to http://localhost:3000/webhooks, then text your BlueBot number from another phone. The CLI forwards the event to your handler, signed. BlueBot copies texts from people you’ve texted through it, unless you set Which chats to copy to Everything.

Before you turn it on

  • Text only people who asked to hear from you. Anyone who replies STOP goes on your stop list, and BlueBot cancels texts to them. Stop words
  • A text that can’t go yet waits with a hold rather than failing: quiet hours, your Mac away, a daily limit. Holds
  • Discord with BlueBot on the integrations page says what else the two do together.