> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Post to Discord

> How a Discord server connects through PostSyncer's bot, and what it takes through the API: messages, files, polls, embeds, forum topics and tags, mentions, threads, first comments, deletes, comments and analytics.

A Discord account is a whole server, with `platform` `discord`. PostSyncer's bot posts in it. Each post goes to one channel: `settings.channel_id`, or the channel saved in the account's [Post defaults](/docs/guides/account-defaults.md).

## Connect a server

Make a [connect link](/docs/api-reference/accounts/connect-link.md) with `provider` `discord`, or open **Accounts** in the app. The person who connects picks the server in Discord and adds PostSyncer's bot with the permissions it asks for. They need the right to manage that server.

The bot asks only for what PostSyncer uses: to see channels and read their history (to find a message whose answer was lost), send messages, embed links, attach files, mention everyone (for `allow_mentions` `everyone`), change its nickname, start threads and post in them, manage threads (to delete a thread it started, and to add a forum's moderated tags), and create polls. It doesn't ask to manage messages: it deletes and publishes only its own. Signing in reads only the person's Discord name and id, not their email or their list of servers.

* One server is one account, whatever the number of channels.
* The bot's token doesn't expire, so a server never needs reconnecting on a timer.
* If Discord refuses PostSyncer's bot for a moment, nothing is sent: the post is tried again after 6, 15 and 30 minutes, and a thread goes on from where it stopped. If Discord still refuses it after those tries, the post fails and says so. Comments, first comments and deletes wait, and are tried again for up to 2 hours.
* Disconnecting the account removes the bot from the server, unless PostSyncer still uses it there (another workspace's account of the same server, or team alerts). This is best effort: if Discord doesn't answer, remove the bot in Discord.

## Pick a channel

[List Discord channels](/docs/api-reference/accounts/discord-channels.md) (or the MCP tool `list-discord-channels`) gives each channel's `id`, `type` and category, in Discord's own order.

* A post goes to a `text`, `announcement`, `forum` or `media` channel the bot can see and send messages in.
* A forum or media channel lists its `available_tags`, and `requires_tag` says when every post needs one.
* A `channel_id` from another server is refused with `422`.

## What you can post

* A text message.
* Text with up to 10 photos, videos and PDFs.
* A poll, with no files, in a text or announcement channel.
* An embed card.
* A forum or media channel topic, with a title and tags.
* A thread: the message, then replies in its thread.

## Settings

Every key but `channel_id` is optional. [Create a post](/docs/api-reference/posts/create.md#platform-specific-settings) has the full list.

| Key | What it does |
| - | - |
| `channel_id` | The channel's id. Needed to publish, unless the account's Post defaults have one. |
| `text` | Discord's own text, instead of the post's text. |
| `thread_name` | A forum or media topic's title, needed there to schedule or publish; elsewhere, the title of the thread the post starts. 1 to 100 characters. |
| `applied_tags` | Up to 5 of the forum's tag ids, from `available_tags`. |
| `auto_archive_duration` | Minutes before the thread hides when nobody writes: `60`, `1440`, `4320` or `10080`. |
| `embed` | A card: `title` (256), `description` (4,096), `url`, `color` (hex, `#5865F2`), `footer` (2,048), 6,000 characters in all. |
| `poll` | `enabled`, `question` (300), `options` (2 to 10, 55 each), `duration_hours` (1 to 768), `multiple`. Text and announcement channels only, and a poll takes no files. |
| `has_spoiler` | Blur the files until someone taps them. |
| `crosspost` | In an announcement channel, publish the message to the servers that follow the channel. |
| `suppress_embeds` | No link previews. |
| `suppress_notifications` | Send without a notification. |
| `allow_mentions` | Who the post's message may ping: `none` (the default), `users`, `roles` or `everyone`. |
| `bot_nickname` | The bot's nickname in this server, up to 32 characters. |
| `hashtags` | Up to 30 hashtags added after the text. |
| `first_comment` | A first reply in the post's thread, when the post has no first comment of its own. |
| `first_comment_delay` | Minutes after the post its first comment goes out, 0 to 10080 (7 days); 1 when left out. `0` sends it with the post. |
| `first_comment_media` | The first comment's media library ids, in order: up to 10 files. |
| `media` | This account's own media library ids, instead of the first item's media. |

## Forums and tags

* A forum or media channel post is a new topic: its title goes in `thread_name`, and up to 5 tags in `applied_tags`.
* To be scheduled or published, the topic needs its title, and a tag when the forum requires one. A draft can wait. Without the title, the API answers `422` on `accounts.N.settings.thread_name`: `A Discord forum post needs a title.`
* A tag that isn't the forum's, or more than 5, is refused with `422`, drafts included.
* Tags only moderators can add (`moderated: true`) work too: the bot asks for the Manage Threads permission they need. If the bot's role in the server doesn't have it, Discord refuses the post.
* A forum or media channel takes no poll.
* A media channel topic needs a photo or a video. PostSyncer doesn't check this when the post is saved: Discord refuses a topic without one when it's published, and the post fails.

## Mentions

`allow_mentions` decides who the post's message may ping, and is `none` unless you set it. The thread's other items, the first comment and every comment sent from PostSyncer never ping anyone: not `@everyone`, `@here` or a role.

## Text

* A message takes 2,000 characters. A longer one is refused with `422` when the post is scheduled or published (a draft isn't checked), never cut, and one that still reaches the publish fails with a note giving its length. Give Discord its own shorter text in `settings.text`.
* Discord's own formatting works: `**bold**`, `*italic*`, `> quotes`, code blocks and links.

## Media

| | Limit |
| - | - |
| Files in one message | Up to 10 |
| Each file | Up to 20 MB |
| All files in one message | Up to 24.5 MB (25,690,112 bytes) |
| Picture types | JPG, PNG, GIF, WebP |
| Video types | MP4, MOV, WebM |
| Document types | PDF |

* Photos, videos and PDFs can go in the same message.
* A file over 20 MB, or files over 24.5 MB together, are refused with `422`, saying which.
* A file's alt text, set in the app's media library, goes with it.
* TXT and CSV files can't be added to the media library. Share them as a link.

## Polls

* A poll takes a question, 2 to 10 answers, and stays open from 1 hour to 32 days (`duration_hours` 1 to 768; 24 when you leave it out). `multiple` lets people pick more than one.
* A poll goes in a text or announcement channel. One for a forum or media channel is refused with `422` when the post is saved, drafts included.
* Discord doesn't take a poll and files on the same message: that's refused with `422`.
* The bot needs Discord's Create Polls permission, which it asks for when it's added.

## More than one item

Each item after the first is a message in the post's thread: the thread the post starts (titled with `thread_name`, or the start of its text), or the forum topic itself. A first comment (`is_first_comment: true`) goes there too. With `first_comment_delay` `0` it goes out with the post; with a delay (1 minute when you leave it out), it's posted that many minutes later.

If a reply fails after the message went out, the post is still published, with a note of what didn't go out. When `crosspost` can't be done, the post stays published with a `setting_not_applied` note.

## Delete a post

Deleting the post in PostSyncer deletes it on Discord too:

* A forum or media channel post is its own thread: the whole topic goes, members' replies included.
* A text or announcement channel post takes with it the thread PostSyncer's bot started for its replies, members' replies in that thread included.
* A thread a member started is never deleted. PostSyncer deletes only its own messages in it.

A message already gone counts as deleted. [Test safely](/docs/test-safely.md#what-cant-be-undone) says what happens when Discord refuses.

## Comments

* PostSyncer doesn't read the post's thread, so replies other people write don't show in the comments screen.
* A comment sent from PostSyncer goes in the post's thread, with photos or files, and never pings anyone. It can be deleted from PostSyncer.
* Discord can't hide comments: hide answers `422` with `Discord can't hide comments. Delete the comment instead.`

## Analytics

Discord gives `likes` (the message's reactions) and `comments` (the messages in its thread), when the post started one. It gives no `impressions`, so `engagement_rate` is `null`. The server's member count is its followers. See [Read analytics](/docs/guides/analytics.md).

## Example

A poll in a text channel:

```json theme={null}
{
  "workspace_id": 4815,
  "schedule_type": "draft",
  "content": [
    { "text": "Which origin should we roast next month?" }
  ],
  "accounts": [
    {
      "id": 16412,
      "settings": {
        "channel_id": "222333444555666777",
        "poll": {
          "enabled": true,
          "question": "Which origin next?",
          "options": ["Ethiopia Guji", "Colombia Huila", "Kenya Nyeri"],
          "duration_hours": 48,
          "multiple": false
        }
      }
    }
  ]
}
```

## Related

> [card] [List Discord channels](/docs/api-reference/accounts/discord-channels.md)
>
> The channels and forum tags a post can use.

> [card] [Compare the 14 networks](/docs/platforms/overview.md)
>
> How Discord differs from the other networks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.