App Logo
Messaging

Archive a Discord channel without any permissions and automatically save its chats to a database

Prompt template

Archive every message of #channel in my Discord server server name: read it page by page, oldest pages included, and save the author, time, text and link of each message to database or file.

Overview

A server you are in will delete a channel, and you want to keep its history. As a regular member you cannot archive it, change its settings or add a bot. With Reduck, Claude, ChatGPT or any AI agent reads the channel as you, page by page, and saves every message before it is gone. To keep saving new messages, the Reduck CLI runs the same reads from a cron job and writes them to a database.

Why it's hard

Discord has no export button. Archiving a channel inside Discord, by hiding it, locking it or moving it to an archive category, needs the Manage Channels permission, and a logging bot that writes messages to a database has to be added by someone with Manage Server. Discord's data package holds only the messages you sent. DiscordChatExporter exports a whole channel, but it asks for your Discord token, which works like your password, and its own FAQ says that automating a user account is technically against Discord's terms. Copying 3,000 messages by hand is not realistic.

How Reduck does it

Reduck runs Discord actions in your own Chrome, where you are already signed in, so it sees every channel you can see, with no token. It finds the server with list_servers and the channel with list_channels. Then it calls search_messages on that channel alone, 25 messages per call, and follows next_offset until the last page: each message comes back with its id, author, time, text and link, with Discord's total count to check that nothing is missing.

  • Once, from your agent: ask Claude or ChatGPT, and it writes the messages to a file, as CSV, JSON or a readable transcript.
  • Every day, to a database: the CLI prints each page as JSON, and a short script writes it to a table keyed on the message id.

Save a Discord channel to a database automatically

Get the server id and the channel id from your agent (list_servers, list_channels) or from Discord's developer mode. Then save this as save-discord.sh:

#!/bin/bash
SERVER=123456789012345678
CHANNEL=234567890123456789

sqlite3 discord.db "CREATE TABLE IF NOT EXISTS messages (id TEXT PRIMARY KEY, author TEXT, time TEXT, text TEXT, link TEXT)"
offset=0
while [ "$offset" != "null" ]; do
  npx @reduck-ai/cli@latest run --script reduck/discord.com/search_messages \
    guildId=$SERVER "channelIds=[\"$CHANNEL\"]" offset=$offset > page.json || exit 1
  added=$(sqlite3 discord.db "INSERT OR IGNORE INTO messages
    SELECT json_extract(value, '$.messageId'), json_extract(value, '$.author.name'),
           json_extract(value, '$.timestamp'), json_extract(value, '$.content'), json_extract(value, '$.url')
    FROM json_each(readfile('page.json'), '$.messages'); SELECT changes();")
  [ "$added" = "0" ] && break
  offset=$(jq -r '.next_offset' page.json)
done

The first run reads the whole channel. The next runs stop at the first page with no new message. Run it every morning with cron, with an API key in REDUCK_API_KEY:

0 8 * * * cd ~/discord-archive && ./save-discord.sh

To write to Postgres or another database, call the same script from your own code with the REST API: POST /run with your API key in x-api-key, the script reduck/discord.com/search_messages and its arguments, and "browser": "extension" so the run uses your signed-in Chrome. The answer holds the same JSON page of messages.

Tools

Script What it does Takes
list_servers The servers you are a member of, with their ids nothing
list_channels A server's channels, with their ids and links the server id
search_messages One page of 25 messages of a channel, with the total count and the next page the server id, the channel id, the offset
read_messages The latest messages of a channel, thread or forum post its url, how many

Connect it

  1. Install the Reduck extension in Chrome and stay signed in to Discord there, in one tab only.
  2. Add Reduck to your client: Claude Code, Claude Desktop, ChatGPT or any other MCP client, or install the Reduck CLI.
  3. Ask: "Archive every message of #{channel} in my Discord server {server name}, page by page, and save the author, time, text and link of each message to {database or file}."

Ways to save a Discord channel as a regular member

Method Other members' messages No permissions, no token Saved to a database, on a schedule Images and files
Copy by hand Yes Yes No By hand
Discord data package No, only yours Yes No Only yours
Logging bot Yes No, needs Manage Server Yes Depends on the bot
DiscordChatExporter Yes No, needs your token Files only, with a cron job Yes
Reduck Yes Yes Yes, with the CLI or API No, text and links

Who it's for

  • Members of a server that is about to delete or clean up channels
  • Community members who want to keep a channel's history in their own database, without admin rights
  • Developers who want a daily copy of a Discord channel without a bot or a user token

FAQ

You cannot archive it inside Discord: hiding, locking or moving a channel needs the Manage Channels permission, and adding an archive bot needs Manage Server. What you can do as a regular member is keep a copy of everything you can read. Reduck does it from your own account: if you can scroll the channel, your agent can save it.
Run the Reduck CLI from a cron job. Each call of search_messages prints one page of 25 messages as JSON; the script on this page writes them to a SQLite table keyed on the message id, so a message is saved once, and stops at the first page that adds nothing new. To write to Postgres or another database from your own code, call the REST API instead (POST /run with your API key, and browser set to extension so the run uses your signed-in Chrome).
No. The scripts run in your own Chrome, where you are signed in to Discord, through the Reduck extension. The cron job works while that Chrome is open. Keep Discord open in one tab only: Discord allows one active tab, so the calls run one after the other.
search_messages reads a channel 25 messages at a time, newest first, with Discord's total count and the next page to read. Tested on 2026-10-21 on a channel of 5,687 messages: it read 25 messages at offset 2,500, so a channel of 3,000 messages is about 120 calls. Each call is one script run. read_messages is faster for the latest messages, but in the same test it stopped at 130 messages, so it is not the way to save a long history.
No. It saves each message's author, time, text and link. Attachments, images and embeds are not downloaded. DiscordChatExporter has a Download media option for that; if the images matter, save them by hand or use that option.
DiscordChatExporter is a free, open-source desktop app and CLI that exports a channel to HTML, TXT, CSV or JSON, with media. It needs your Discord token, and its own FAQ says the GUI saves that token to a plain text file unless you turn it off, and that automating user accounts is technically against Discord's terms. Reduck needs no token: it reads the Discord tab you are already signed in to. It is slower, it saves text only, and it runs from your AI agent or the Reduck CLI.
Not for this. Discord's own help page says the messages folder of your data package holds the messages you sent, and that the package arrives within 30 days. The other members' messages in the channel are not in it.
No. A deleted message or channel is gone from Discord's servers, for every tool. Start before the deletion date, and run the cron job often enough to save messages before they are deleted.
Discord's terms restrict automated user accounts ("self-bots"). Reduck acts in your own browser, one call at a time, with no token and no change to the Discord client, but reading a channel from a script is still automation of your account. We cannot promise Discord will never flag it. The archive holds other members' messages: keep it for yourself unless they agree to share it.
Yes. Reduck connects to ChatGPT, Claude, Claude Code, Codex, Cursor and any other MCP client. In Claude Code or Codex the agent can write the messages to a file or a local database; in a chat app it gives you the file to download. For a job that runs on its own every day, use the CLI.

Similar use cases

Discord

Search Discord with AI

Ask ChatGPT or Claude what was said in your Discord servers and DMs. Every way to do it, compared, and one that reads both as you, with no bot and no token.

Messaging
Discord

Summarize a Discord server

Let Claude, ChatGPT or any AI agent read the Discord servers you are a member of and summarize what you missed, channel by channel, with links to the messages, from your own account, with no bot to add and no admin rights.

Messaging
Discord

Discord MCP

A Discord MCP server that acts as your own user account, not as a bot. Reduck gives ChatGPT, Claude or any MCP client tools to read your servers, channels and DMs and reply as you, through browser automation in your own Chrome, with no bot to invite and no user token to paste.

Messaging

Start building not clicking