by bicybert
Sync Discord channel messages into your vault as Markdown notes. One note per channel, one heading per message.
Discord Channel Sync
An Obsidian plugin that syncs Discord channel messages into your vault as markdown notes.
- One note per channel —
Discord/general.mdcontains the whole channel - One heading per message —
## Username — 2026-01-05 14:32followed by the message content - Attachments are downloaded locally — Discord CDN links expire, so images and files are saved into your vault and embedded with
![[...]] - Attachment organization — customizable root folder, with optional subfolders per channel and per file type (
images/,files/) - Incremental sync — the plugin remembers the last synced message per channel and only fetches what's new
- Handles rate limits — 429 responses are retried with Discord's
retry_after
Example output
---
channel: "general"
channel-id: "123456789012345678"
server: "My Server"
synced: 2026-11-14T14:00:00.000Z
---
## alice — 2026-01-04 09:15
Check out this config
![[Discord/attachments/general/images/120938123-image.png]]
## bob — 2026-01-04 09:17
> ↩ **replying to alice:**
> Check out this config
nice, that fixed it for me too
Attachment storage
Attachments are stored under the Attachments folder you set in the plugin settings. With both organization options on (the defaults), the layout is:
Discord/attachments/ ← customizable root
└── general/ ← per-channel subfolder (toggleable)
├── images/ ← image attachments (toggleable)
│ └── 120938123-image.png
└── files/ ← PDFs, zips, everything else (toggleable)
└── 120939456-doc.pdf
- Organize attachments by channel — each channel gets a subfolder named after it, so you always know where an image came from. Turn it off to keep everything flat in the root folder.
- Separate images and files — splits into
images/andfiles/based on the attachment's content type. Turn it off to mix everything in one folder. - Every file is prefixed with its Discord attachment ID (
120938123-image.png), so re-syncs never overwrite or duplicate files, even across channels.
Setup
1. Create the Discord bot
- Go to the Discord Developer Portal → New Application.
- Open Bot → Add Bot, then copy the token.
- Under Privileged Gateway Intents, enable Message Content Intent (required to read message text).
- Go to OAuth2 → URL Generator, check the
botscope, and grant these permissions:- View Channels
- Read Message History
- Open the generated URL and invite the bot to your server.
Bots don't run locally. A Discord bot is hosted by Discord — once you invite it via the OAuth2 URL it's online and stays up on its own. There's nothing to start or stop from Obsidian. If the bot looks offline in Discord, it means it wasn't invited, was removed, or its token was reset. Use the Invite bot button in the plugin settings to re-open the portal.
2. Build and install the plugin
npm install
npm run build
Then copy everything in the build/ folder into your vault at .obsidian/plugins/discord-channel-sync/:
build/manifest.jsonbuild/main.jsbuild/main.css
Enable the plugin in Obsidian's Settings → Community plugins.
3. Configure
In the plugin settings:
- Paste your bot token.
- Click Load server list — every server the bot has been invited to appears in a dropdown. Pick one.
- The channel list loads automatically; toggle the channels you want to sync.
- Click the ribbon icon (or run Sync selected Discord channels from the command palette).
Optional checks before syncing: Boot verifies the token and server access, and Send test message posts a hello into your first enabled channel (needs the bot's Send Messages permission).
Notes
- Your bot token is stored in
data.jsoninside the plugin folder — never commit it (it's already in this repo's.gitignore). - First sync pulls the most recent Initial message limit (default 500) messages per channel. Every sync after that only fetches new messages.
- Only regular text channels are synced (forum/thread channels are skipped in this version).
- Do not use a user token (self-botting) — it violates Discord's ToS and can get your account banned.
- Verify the bot is online before syncing: click Boot in the plugin settings (or run Verify Discord bot identity from the command palette). It shows the bot's Discord user ID and name — match that ID to the member list in your server to confirm it's the right bot. If Boot fails, click Invite bot to re-open the Developer Portal and re-invite it.
Development
npm run dev— watch mode buildnpm run build— typecheck + production build (build/folder)npm run release [patch|minor|major]— bump the version, commit, tag, and push; GitHub Actions then builds and publishes a GitHub release automatically- Source lives in
src/:discord.ts(API client),renderer.ts(markdown generation),settings.ts,main.ts(sync logic)
Note for existing users (v0.2.0)
The plugin ID changed from discord-to-obsidian to discord-channel-sync in v0.2.0 (required for community store submission — IDs cannot contain "obsidian"). Obsidian treats these as two different plugins:
- Install the new version (via BRAT or manually into
.obsidian/plugins/discord-channel-sync/). - To keep your token and channel selection: with Obsidian closed, copy
data.jsonfrom the old plugin folder into the new one. - Disable or remove the old plugin.
Updating an installed plugin
- From the community store (once submitted): updates appear in Obsidian's plugin settings like any other plugin.
- Before store submission: install BRAT, add
bicybert/discord-to-obsidian, and it will pull every new GitHub release automatically. Or manually re-copy thebuild/files.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.