Skip to main content

Prerequisites

Setup

Open the in Courier, enter your bot token, then save.

Scopes

Update the bot scope with these permissions:
  • View Channels
  • Send Messages
  • Optional: Read Message History to send a message as a reply to another message
See Discord’s guide to adding scopes and permissions. Open the generated invite URL. It adds the bot to the server with the permissions you chose.

Profile requirements

Discord addresses the recipient by user ID or channel ID, under discord on the profile. Store either one once with , which merges into the profile and creates it if it does not exist:
1

Open User Settings

Go to User Settings on Discord (next to profile on the bottom left).
2

Enable Developer Mode

Open Advanced settings and enable Developer Mode .
3

Copy the user ID

Right click on the user and copy the user ID.
This is not the user tag. The user you are trying to message must be a member of a server the bot is installed in.
Then send to user_id and Courier resolves the address. For a one-off with no stored profile, pass it inline instead: "to": { "discord": { "user_id": "617099137532932107" } }.

Send by user id

The call in every language, and the rest of the profile object.

Send to a recipient

Courier reads discord off the saved profile, so preferences apply and the value can change without touching this code.

Overrides

covers the two levels and which one wins. A provider override changes what Courier sends to Discord’s Create Message endpoint. Overrides are deep-merged into the request. Fields you set replace their counterparts, and everything you leave out is still sent. For example, add an embed.

Provider details

Courier recommends routing to the channel. Naming this key in routing.channels instead is supported, and sends through just this provider.

Send to a specific provider

When that is worth doing, and what you give up: failover, channel priority, and providers you add later.