List pinned messages
Returns the channel's pinned messages, sorted most-recently-pinned first. Discord caps a channel at 50 pinned messages and returns the full list unpaginated.
Bot needs READ_MESSAGE_HISTORY in the channel (granted by default BOT_PERMISSIONS).
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Discord channel snowflake.
Query Parameters
SocialAccount _id of any Discord account in the same guild.
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.discord.listDiscordPinnedMessages({ path: { channelId: 'channel_abc123', }, query: { accountId: 'account_abc123', },});console.log(data);{
"data": [
{
"id": "string",
"channel_id": "string",
"content": "string",
"timestamp": "2019-08-24T14:15:22Z",
"author": {},
"attachments": [
{}
],
"embeds": [
{}
]
}
]
}{
"error": "Unauthorized"
}Send a Discord Direct Message POST
Send a 1:1 Direct Message from the bot to a Discord user (by snowflake ID). Supports the same payload shape as channel posts — content, embeds, media attachments, and TTS. Constraints (Discord platform limits): - The bot can only DM users it shares at least one guild with. - If the recipient has DMs disabled for non-friends, Discord returns 403 (surfaces as a 502 platform error). - `content` capped at 2,000 chars. - At least one of `content`, `embeds`, or `attachments` is required. - The recipient must be identified by Discord snowflake ID (not username). This is a dedicated endpoint rather than a `POST /v1/posts` variant because DMs are 1:1 operational messages (onboarding, billing reminders, support pings) with a different lifecycle than scheduled channel posts. DMs are not persisted to `Post` / `ExternalPost` and are always sent immediately.
Pin a Discord message PUT
Pin a specific message in a channel. Path shape mirrors Discord's own API (`PUT /channels/{cid}/pins/{mid}`). Idempotent — re-pinning an already-pinned message is a 204 no-op. Constraints: - Bot needs MANAGE_MESSAGES in the channel. - 50-pin cap per channel — hitting it returns 400 (Discord-side). Caller should unpin one first.