Agent skill

Discord Channel for NanoClaw

by nanocoai in nanocoai/nanoclaw

Adds a Discord bot channel to NanoClaw through the Chat SDK bridge, with the adapter copied in from the channels branch and a registration test.

MITAuto-check: notesProductivity & Automation

Install Discord Channel for NanoClaw

skills CLI
$ npx skills add nanocoai/nanoclaw --skill add-discord -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nanocoai/nanoclaw add-discord --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nanocoai/nanoclaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/add-discord .claude/skills/add-discord && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-discord
GitHub stars
31k
Token cost
~2.2k tokens
SKILL.md length
973 words
Files
3
Skills in repo
59
Repo updated
First seen
Licence
MIT

At a glance

Adds a Discord bot channel to NanoClaw through the Chat SDK bridge, with the adapter copied in from the channels branch and a registration test.

  • Works in 4 steps: Copy the adapter and its registration test → Register the adapter → Install the adapter package → …
  • Letting a NanoClaw agent answer in a Discord server
  • SKILL.md covers Apply, Credentials, Restart and Invite the bot to a shared…, plus 4 more sections
  • Calls pnpm and bash; reaches discord.com; needs DISCORD_PUBLIC_KEY and DISCORD_BOT_TOKEN

What it does

Discord support arrives through the Chat SDK bridge, with the adapter copied in from the `channels` branch because NanoClaw keeps channels out of trunk. Four steps do the work: copy the adapter and its registration test into `src/channels/`, append one import to the channel barrel, install `@chat-adapter/discord` at an exact pinned version, since the supply-chain policy refuses ranges and `latest`, then build and run the registration test.

The code alone cannot receive messages. The bot has to be created by hand in the Discord Developer Portal: make an application, reset the token and copy it, turn on Message Content Intent and put the bot in a server you share. The skill marks these as operator instructions because no parser can click through the portal. Delivery against a real server is confirmed manually once the service runs, and a `REMOVE.md` and an apply-fixtures file ship with the skill.

When your agent uses it

  • Letting a NanoClaw agent answer in a Discord server
  • Setting up a new Discord bot application for an agent
  • Re-applying the Discord adapter after updating NanoClaw

Example prompts

  • “Add Discord to NanoClaw and walk me through creating the bot in the Developer Portal.”
  • “Install the Discord adapter and run its registration test.”
  • “My Discord bot is online but ignores messages. Check whether Message Content Intent is the problem.”

Requirements

  • A NanoClaw installation with pnpm
  • A Discord bot application and token

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Copy the adapter and its registration test
  2. Register the adapter
  3. Install the adapter package
  4. Build and validate

What it can do on your machine

Read from SKILL.md and the folder at commit af699e7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm
    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • discord.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • DISCORD_PUBLIC_KEY
    • DISCORD_BOT_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Discord Channel for NanoClaw loads about 2.2k tokens when it runs. Until then it costs about 15 tokens; SKILL.md has 973 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~15
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:98
    `.env` and fails to start without `DISCORD_PUBLIC_KEY` and `DISCORD_APPLICATION_ID`

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nanocoai/nanoclaw at commit af699e7, republished under its MIT licence (© nanocoai). 973 words, ~2,154 tokens.

Download SKILL.mdSave it as .claude/skills/add-discord/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
add-discord
description
Add Discord bot channel integration via Chat SDK.

Add Discord Channel

Adds Discord bot support via the Chat SDK bridge. NanoClaw doesn't ship channels in trunk — this skill copies the Discord adapter in from the channels branch.

The mechanical steps under Apply carry nc: directive fences: an agent reads the prose and applies them, and a parser can apply them deterministically from the same document. Every directive is idempotent, so the whole skill is safe to re-run; anything a parser can't apply falls back to the prose beside it.

Apply

1. Copy the adapter and its registration test

Fetch the channels branch and copy the Discord adapter and its registration test into src/channels/ (overwrite — the branch is canonical):

nccopy
src/channels/discord.ts
src/channels/discord-registration.test.ts
2. Register the adapter

Append the self-registration import to the channel barrel (skipped if the line is already present). This one line is the skill's only reach-in into core:

ncappend
import './discord.js';
3. Install the adapter package

Pinned to an exact version — the supply-chain policy rejects ranges and latest:

ncdep
@chat-adapter/discord@4.29.0
4. Build and validate

Build first: it guards the typed createChatSdkBridge(...) core call and proves the dependency is installed. Then run the one integration test.

ncrun
pnpm run build
ncrun
pnpm exec vitest run src/channels/discord-registration.test.ts

discord-registration.test.ts imports the real channel barrel and asserts the registry contains discord. It goes red if the import line is deleted or drifts, if the barrel fails to evaluate, or if @chat-adapter/discord isn't installed (the import throws) — so it also covers the dependency from step 3. End-to-end delivery against a real server is verified manually once the service runs.

Credentials

Discord app setup is human and interactive — no parser can click through the Discord Developer Portal. The adapter is installed and registered, but it can't receive a message until the bot exists, has Message Content Intent, and shares a server with you. Tell the user:

ncoperator
Create the Discord bot:
1. Go to https://discord.com/developers/applications → New Application. Name it (e.g. "NanoClaw Assistant").
2. Bot tab → Add Bot if needed → Reset Token, then copy the Bot Token (it's shown only once).
3. Bot tab → Privileged Gateway Intents → enable Message Content Intent.
4. OAuth2 → URL Generator → Scopes: bot; Bot Permissions: Send Messages, Read Message History, Add Reactions, Attach Files, Use Slash Commands.
5. Open the generated URL and invite the bot to a server you're also in (a personal server is fine) — the bot can only DM you once you share a server.

Paste the Bot Token (it's shown only once). You don't paste the Application ID or the Public Key by hand — the bot's own application record carries both, so a single call derives them from the token:

ncprompt
Paste the Bot Token — Bot tab. Click `Reset Token` if you need a new one.

Read the application's own record. GET /oauth2/applications/@me returns the Application ID (id), the Public Key (verify_key), and your own account as the app's owner (owner.id) — so the App ID, the Public Key, and your Discord user ID all come from this one call instead of being copied by hand. A bad token fails here, before the restart, rather than silently later:

ncrun
curl -sf https://discord.com/api/v10/oauth2/applications/@me -H "Authorization: Bot {{bot_token}}"

Store the token and the two derived credentials — the adapter reads them from .env and fails to start without DISCORD_PUBLIC_KEY and DISCORD_APPLICATION_ID (set-if-absent, so a value you've already filled in is never overwritten):

ncenv-set
DISCORD_BOT_TOKEN={{bot_token}}
DISCORD_APPLICATION_ID={{application_id}}
DISCORD_PUBLIC_KEY={{public_key}}

Restart

Restart the service so it loads the Discord adapter and the credentials you just stored, and wait for its CLI socket before resolving:

ncrun
bash setup/lib/restart.sh

Invite the bot to a shared server

The bot can only DM you once it shares a server with you. If you didn't already invite it via the OAuth2 URL Generator while setting up the app, do it now: add the bot to a server you're also in (a personal server is fine). Tell the user:

ncoperator
Open the invite link — https://discord.com/oauth2/authorize?client_id={{application_id}}&scope=bot&permissions=2147584064 — and add the bot to a server you're also in (a personal server works fine); the bot can only DM you once you share a server. If you already invited it while setting up the app, you can skip this.

Resolve your DM channel

The agent talks to you in your direct-message channel with the bot. Your Discord user ID was already derived as the application's owner (owner_handle), so all that's left is to open the DM and read back its channel id.

Open the DM with POST /users/@me/channels and take the channel id it returns as the conversation address discord:@me:<channelId> (if Discord refuses, the bot doesn't share a server with you yet — invite it, then retry):

ncrun
curl -s -X POST https://discord.com/api/v10/users/@me/channels -H "Authorization: Bot {{bot_token}}" -H "Content-Type: application/json" -d '{"recipient_id":"{{owner_handle}}"}' | jq -er '"discord:@me:" + .id'

owner_handle and platform_id are what the owner-wiring step needs. The greeting goes out over the DM channel, which works as soon as the bot shares a server with you.

Show full SKILL.md (371 more words)Show less

Next Steps

If you're in the middle of /setup, return to the setup flow now. Otherwise wire this channel with /init-first-agent (or /manage-channels).

Channel Info

  • type: discord
  • terminology: Discord has "servers" (also called "guilds") containing "channels." Text channels start with #. The bot can also receive direct messages.
  • platform-id-format: discord:@me:{dmChannelId} for the owner DM (e.g. discord:@me:1399...), discord:{guildId}:{channelId} for server channels — both IDs required for channels.
  • how-to-find-id: Enable Developer Mode in Discord (Settings > App Settings > Advanced > Developer Mode). Then right-click a server and select "Copy Server ID" for the guild ID, and right-click the text channel and select "Copy Channel ID." The platform ID format used in registration is discord:{guildId}:{channelId} — both IDs are required.
  • supports-threads: yes
  • typical-use: Interactive chat — server channels or direct messages
  • default-isolation: Same agent group for your personal server. Separate agent group for servers with different communities or where different members have different information boundaries.

Troubleshooting

The Bot Token paste is rejected. The token must be at least 50 characters of letters, digits, dots, underscores, and hyphens — a real Bot Token has two . separators. It lives under Bot → Reset Token in the Developer Portal and is shown only once; reset to get a fresh one. The short numeric Application ID and the OAuth2 Client Secret are different values and won't pass.

applications/@me returns 401. The token was reset since you copied it, or a stray space/newline came along with the paste. Reset the token in the Bot tab and re-run the check — it fails here on purpose, before the restart, while the credential is still cheap to fix.

The bot is online but never sees your messages. Two usual causes: Message Content Intent is off (Bot tab → Privileged Gateway Intents), so message bodies arrive empty and nothing triggers; or the bot doesn't share a server with you — in which case POST /users/@me/channels also refuses. Open the invite URL and add the bot to a server you're in, then retry.

Adapter looks installed but Discord never connects. Run pnpm exec vitest run src/channels/discord-registration.test.ts — red means the barrel import or the @chat-adapter/discord install drifted, so re-run the Apply steps. If it's green, the service probably hasn't restarted since the credentials were stored: bash setup/lib/restart.sh, then check logs/nanoclaw.error.log for missing DISCORD_PUBLIC_KEY / DISCORD_APPLICATION_ID complaints.

© nanocoai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in .claude/skills/add-discord of nanocoai/nanoclaw.

  • SKILL.md
  • REMOVE.md
  • apply-fixtures.json

Open the folder on GitHubat commit af699e7

Compare with similar skills

Discord Channel for NanoClaw next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Discord Channel for NanoClaw compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Discord Channel for NanoClaw this skillnanocoai/nanoclaw31k—~2.2kAutomated safety check: NotesMIT
Discord App Setupvellum-ai/vellum-assistant1.4k—~4.2kAutomated safety check: PassMIT
Easy Openclawdaheiai/easy-openclaw112—~1.7kAutomated safety check: NotesNone
Discrawlopenclaw/openclaw392k—~698Automated safety check: PassMIT
Message Push0xranx/golembot322—~984Automated safety check: PassMIT
Task Manager0xranx/golembot322—~694Automated safety check: PassMIT

Similar skills

  • Discord App Setup

    vellum-ai/vellum-assistant

    Connect a Discord bot to the assistant via the Discord Gateway with guided application creation and intent configuration

    1.4k GitHub stars~4.2k tokensUpdated yesterday
    Productivity & AutomationAuto-check passed
  • Easy Openclaw

    daheiai/easy-openclaw

    OpenClaw 配置优化向导。采用“第 0 层测试观测(可选)+ 前 3 轮优化 + 第 4 轮接入扩展”流程:基础推荐层(含联网搜索与权限模式)、渠道增强层(Discord/Feishu/Telegram 分支优化)、Skills 推荐层(可执行可跳过)、新增渠道接入引导(可跳过)。用于帮助用户快速完成 OpenClaw 初始化或优化配置。用户说到“优化…

    112 GitHub stars~1.7k tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check: notes
  • Discrawl

    openclaw/openclaw

    Discord archive: search, sync freshness, DMs, summaries, TUI, repo/release work.

    392k GitHub stars~698 tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Message Push

    0xranx/golembot

    Send proactive messages to IM groups or individual users via the gateway Send API.

    322 GitHub stars~984 tokensUpdated 11 days ago
    Productivity & AutomationAuto-check passed
  • Task Manager

    0xranx/golembot

    Creates and manages scheduled tasks, cron jobs, recurring reminders, and timers via the Task HTTP API.

    322 GitHub stars~694 tokensUpdated 11 days ago
    Productivity & AutomationAuto-check passed
  • Channel Config

    OPPO-Mente-Lab/X-OmniClaw

    Configure messaging channels in X-OmniClaw, including Feishu and Discord.

    265 GitHub stars~419 tokensUpdated 4 mo ago
    Productivity & AutomationAuto-check passed

More from nanocoai/nanoclaw

All 59 skills in this repo
  • Installs or refreshes Iron Proxy and its Iron Control web console for NanoClaw, with a local Docker setup, database, credentials and a human approval bridge.

    31k GitHub stars~4.6k tokensUpdated yesterday
    Auto-check: notes
  • Installs or refreshes OneCLI as the gateway provider for NanoClaw, copying the adapter files, registering the provider and running the setup script.

    31k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check: notes
  • Agent Browser

    nanocoai/nanoclaw

    Drives a web browser from the shell with the agent-browser CLI: open pages, read an element snapshot, click and fill by reference, grab text and screenshots.

    31k GitHub starsUsed in 2 repos~1.6k tokens
    Auto-check passed
  • Add Dial Tool

    nanocoai/nanoclaw

    Installs the `dial` CLI and a credential in NanoClaw agent containers so chosen agents can send SMS, place AI voice calls and receive verification codes.

    31k GitHub stars~4.8k tokensUpdated yesterday
    Auto-check passed
  • Guides a conversational migration from an OpenClaw install to NanoClaw v2, carrying over identity, channel credentials, scheduled tasks and workspace files.

    31k GitHub stars~6k tokensUpdated yesterday
    Auto-check: notes
  • Wires up an additional phone number onto an already-installed Dial channel, so one NanoClaw install answers SMS and AI voice calls on more than one line.

    31k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Discord Channel for NanoClaw

What does Discord Channel for NanoClaw do?

Adds a Discord bot channel to NanoClaw through the Chat SDK bridge, with the adapter copied in from the channels branch and a registration test. Discord support arrives through the Chat SDK bridge, with the adapter copied in from the `channels` branch because NanoClaw keeps channels out of trunk. Four steps do the work: copy the adapter and its registration test into `src/channels/`, append one import to the channel barrel, install `@chat-adapter/discord` at an exact pinned version, since the supply-chain policy refuses ranges and `latest`, then build and run the registration test.

When should I use Discord Channel for NanoClaw?

Discord Channel for NanoClaw fits situations like: letting a NanoClaw agent answer in a Discord server; setting up a new Discord bot application for an agent; re-applying the Discord adapter after updating NanoClaw.

How do I install Discord Channel for NanoClaw in Claude Code?

Run `npx skills add nanocoai/nanoclaw --skill add-discord -a claude-code`. Or copy the skill folder (.claude/skills/add-discord in nanocoai/nanoclaw) into .claude/skills/add-discord in your project. Claude Code loads it when a task matches its description.

How do I install Discord Channel for NanoClaw in Codex?

Run `npx skills add nanocoai/nanoclaw --skill add-discord -a codex`. Or copy the skill folder (.claude/skills/add-discord in nanocoai/nanoclaw) into .agents/skills/add-discord in your project. Codex loads it when a task matches its description.

Can I use Discord Channel for NanoClaw in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nanocoai/nanoclaw --skill add-discord -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-discord, .gemini/skills/add-discord, .github/skills/add-discord and .opencode/skills/add-discord in your project.

What does Discord Channel for NanoClaw need to run?

Going by SKILL.md and its folder, Discord Channel for NanoClaw needs the command-line tools its instructions call (pnpm and bash) and credentials named DISCORD_PUBLIC_KEY and DISCORD_BOT_TOKEN. Our summary lists: A NanoClaw installation with pnpm; A Discord bot application and token.

Does Discord Channel for NanoClaw access the network?

SKILL.md names 1 domain. In commands or code: discord.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Discord Channel for NanoClaw safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Discord Channel for NanoClaw use?

Discord Channel for NanoClaw is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Discord Channel for NanoClaw use?

About 2.2k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Discord Channel for NanoClaw?

Skills that share tags, products or a category with Discord Channel for NanoClaw: Discord App Setup (vellum-ai/vellum-assistant, 1.4k stars), Easy Openclaw (daheiai/easy-openclaw, 112 stars), Discrawl (openclaw/openclaw, 392k stars) and Message Push (0xranx/golembot, 322 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Discord Channel for NanoClaw?

nanocoai (a GitHub organization) maintains it in nanocoai/nanoclaw, which has 30,906 GitHub stars. The repository holds 59 skills in this directory. The repository was last updated on October 9, 2026.

Source: nanocoai/nanoclaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.