OverviewProductsPlatformsAPI ReferenceResources
All platforms

Discord

Messaging

Publish messages, embeds, polls, forum posts and threads to Discord channels with the Zernio API, send DMs, manage roles and pins, and create scheduled events, with no bot hosting.

Authentication details

Connecting accounts guide
OAuth 2.0 (Bot)

Permissions2 scopes

Always requested

Publish messages, embeds, polls, forum posts and threads to a Discord channel with POST /v1/posts and platform: "discord".

The same bot sends DMs, lists members, assigns roles, pins messages and creates scheduled events, all over REST.

Quick reference

PropertyValue
Content limit2,000 characters (message content)
Embeds per message10 (max 6,000 characters total)
Images per messageUp to 10 attachments
Image formatsJPEG, PNG, GIF, WebP
Image max size20 MiB default (higher on Boosted servers)
Video formatsMP4
Video max size20 MiB default (higher on Boosted servers)
Post typesMessages, Embeds, Polls, Forum Posts, Threads
SchedulingYes
Direct messagesOutbound only
Role managementYes (list, create, edit, delete, assign, remove)
Member listingYes (list with cursor pagination, search, get one)
Pinned messagesYes (list, pin, unpin)
Scheduled eventsYes (create, list, update, cancel, delete)
Inbox (DM replies)No (Discord requires a Gateway connection)
Inbox (comments)No
AnalyticsNo (Discord Bot API limit)

Before you start

Discord requires Zernio's bot in your server. You do not create a Discord application, request privileged intents or host a gateway connection.

Zernio runs one central bot. The user installs it into their server through OAuth, and you POST to the REST API.

MESSAGE_CONTENT and the other privileged intents are handled on Zernio's bot, and you never open a WebSocket.

The bot asks for these permissions at install time:

  • Send Messages
  • Embed Links
  • Attach Files
  • Send Messages in Threads
  • Create Public Threads
  • Manage Messages (pin and unpin)
  • Manage Roles (role assignment)
  • Manage Events (scheduled events)

Servers connected before Manage Roles and Manage Events were added to the install do not have them, so the role and event endpoints return 502 there.

Ask a server admin to re-invite the bot (the new permissions come with the invite) or to grant the missing permission on the bot's role under Server Settings, Roles.

Connect

Call GET /v1/connect/discord with profileId on Get OAuth connect URL. The user authorizes the bot to join their server.

You then bind a channel with POST /v1/connect/discord (Connect Discord channel).

The full flow, with code for every step, is on Connect.

Publish a post

This request sends a message to a Discord channel right away. platformSpecificData.channelId picks the channel.

TypeScript
const { data: published } = await zernio.posts.createPost({
  body: {
    content: 'Release 2.3 is live. Changelog in the thread below.',
    platforms: [
      {
        platform: 'discord',
        accountId: '66b2e19d8c3f5a7e9d0b1c2d',
        platformSpecificData: { channelId: '1234567890123456789' }
      }
    ],
    publishNow: true
  }
});

console.log(published.post.platforms[0].platformPostUrl);

Every option is on Publish.

In this section

Was this page helpful?

On this page