Discord Sync

Syncs Discord guilds, channels, members, and roles into Payload collections on demand, over HTTP, or on a cron schedule via discord.js.

Community 0 MIT v0.1.7

Installation

pnpm add @lizardglobal/payload-discord-sync

About

This plugin pulls Discord guilds, channels, members, and roles into Payload collections using discord.js. A bot token connects the client, and syncs run on demand from the admin panel, through a programmatic API, over an HTTP endpoint, or on a cron schedule via Payload jobs. Each synced document keeps a `raw` JSON snapshot from Discord plus a `lastSyncedAt` timestamp, so you can query or display the data like any other Payload content. Four collections are registered by default: `discord-guilds`, `discord-channels`, `discord-members`, and `discord-roles`. Every resource can be disabled, renamed, or extended with custom fields through the `resources` option, and a `collectionOverride` hook lets you replace the whole collection config. Member sync needs the Server Members Intent enabled on the bot, and emails only come through when you link members to your users collection via OAuth. The `linkUsers` option connects Discord members to your auth or users collection. It injects a `discordId` field, sets a relationship on members, and can auto-link during sync by Discord ID or email. A `linkDiscordUser` helper handles programmatic linking after a Discord OAuth flow, and `unlinkDiscordUser` reverses it. Sync is on-demand or scheduled; the plugin does not listen to live gateway events like `guildUpdate` or `channelUpdate`, so data reflects the moment of the last sync rather than real-time Discord state. Scheduled syncs register a `discordSync` task and an `autoRun` entry on a `discord-sync` queue, and you control seeding and frequency through the `schedule` config.

Package info

Package name
@lizardglobal/payload-discord-sync
Latest version
0.1.7
Unpacked size
181 kB
License
MIT
Last publish
Jul 27, 2026

Similar plugins

More in Admin