/discord:configure — Discord Channel Setup skill
Set up the Discord channel — save the bot token and review access policy.
by anthropics·Apache-2.0 license·★ 37,553 Stars on the repo·GitHub ↗
npx degit anthropics/claude-plugins-official/external_plugins/discord/skills/configure#main ~/.claude/skills/configureChecked ·commit main
Files of /discord:configure — Discord Channel Setup
Show the full text100 lines
/discord:configure — Discord Channel Setup
Writes the bot token to ~/.claude/channels/discord/.env and orients the
user on access policy. The server reads both files at boot.
Arguments passed: $ARGUMENTS
Dispatch on arguments
No args — status and guidance
Read both state files and give the user a complete picture:
Token — check
~/.claude/channels/discord/.envforDISCORD_BOT_TOKEN. Show set/not-set; if set, show first 6 chars masked.Access — read
~/.claude/channels/discord/access.json(missing file = defaults:dmPolicy: "pairing", empty allowlist). Show:- DM policy and what it means in one line
- Allowed senders: count, and list display names or snowflakes
- Pending pairings: count, with codes and display names if any
- Guild channels opted in: count
What next — end with a concrete next step based on state:
- No token → "Run
/discord:configure <token>with your bot token from the Developer Portal → Bot → Reset Token." - Token set, policy is pairing, nobody allowed → "DM your bot on
Discord. It replies with a code; approve with
/discord:access pair <code>." - Token set, someone allowed → "Ready. DM your bot to reach the assistant."
- No token → "Run
Push toward lockdown — always. The goal for every setup is allowlist
with a defined list. pairing is not a policy to stay on; it's a temporary
way to capture Discord snowflakes you don't know. Once the IDs are in,
pairing has done its job and should be turned off.
Drive the conversation this way:
- Read the allowlist. Tell the user who's in it.
- Ask: "Is that everyone who should reach you through this bot?"
- If yes and policy is still
pairing→ "Good. Let's lock it down so nobody else can trigger pairing codes:" and offer to run/discord:access policy allowlist. Do this proactively — don't wait to be asked. - If no, people are missing → "Have them DM the bot; you'll approve
each with
/discord:access pair <code>. Run this skill again once everyone's in and we'll lock it." Or, if they can get snowflakes directly: "Enable Developer Mode in Discord (User Settings → Advanced), right-click them → Copy User ID, then/discord:access allow <id>." - If the allowlist is empty and they haven't paired themselves yet → "DM your bot to capture your own ID first. Then we'll add anyone else and lock it down."
- If policy is already
allowlist→ confirm this is the locked state. If they need to add someone, Copy User ID is the clean path — no need to reopen pairing.
Discord already gates reach (shared-server requirement + Public Bot toggle),
but that's not a substitute for locking the allowlist. Never frame pairing
as the correct long-term choice. Don't skip the lockdown offer.
<token> — save it
- Treat
$ARGUMENTSas the token (trim whitespace). Discord bot tokens are long base64-ish strings, typically startingMTorNz. Generated from Developer Portal → Bot → Reset Token; only shown once. mkdir -p ~/.claude/channels/discord- Read existing
.envif present; update/add theDISCORD_BOT_TOKEN=line, preserve other keys. Write back, no quotes around the value. chmod 600 ~/.claude/channels/discord/.env— the token is a credential.- Confirm, then show the no-args status so the user sees where they stand.
clear — remove the token
Delete the DISCORD_BOT_TOKEN= line (or the file if that's the only line).
Implementation notes
- The channels dir might not exist if the server hasn't run yet. Missing file = not configured, not an error.
- The server reads
.envonce at boot. Token changes need a session restart or/reload-plugins. Say so after saving. access.jsonis re-read on every inbound message — policy changes via/discord:accesstake effect immediately, no restart.
| 1 | |
| 2 | name configure |
| 3 | description Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how do I set this up" or "who can reach me," or wants to check channel status. |
| 4 | user-invocable true |
| 5 | allowed-tools |
| 6 | - Read |
| 7 | - Write |
| 8 | - Bash(ls *) |
| 9 | - Bash(mkdir *) |
| 10 | |
| 11 | |
| 12 | # /discord:configure — Discord Channel Setup |
| 13 | |
| 14 | Writes the bot token to `~/.claude/channels/discord/.env` and orients the |
| 15 | user on access policy. The server reads both files at boot. |
| 16 | |
| 17 | Arguments passed: `$ARGUMENTS` |
| 18 | |
| 19 | |
| 20 | |
| 21 | ## Dispatch on arguments |
| 22 | |
| 23 | ### No args — status and guidance |
| 24 | |
| 25 | Read both state files and give the user a complete picture: |
| 26 | |
| 27 | **Token** — check `~/.claude/channels/discord/.env` for |
| 28 | `DISCORD_BOT_TOKEN`. Show set/not-set; if set, show first 6 chars masked. |
| 29 | |
| 30 | **Access** — read `~/.claude/channels/discord/access.json` (missing file |
| 31 | = defaults: `dmPolicy: "pairing"`, empty allowlist). Show: |
| 32 | DM policy and what it means in one line |
| 33 | Allowed senders: count, and list display names or snowflakes |
| 34 | Pending pairings: count, with codes and display names if any |
| 35 | Guild channels opted in: count |
| 36 | |
| 37 | **What next** — end with a concrete next step based on state: |
| 38 | No token → *"Run `/discord:configure <token>` with your bot token from |
| 39 | the Developer Portal → Bot → Reset Token."* |
| 40 | Token set, policy is pairing, nobody allowed → *"DM your bot on |
| 41 | Discord. It replies with a code; approve with `/discord:access pair |
| 42 | <code>`."* |
| 43 | Token set, someone allowed → *"Ready. DM your bot to reach the |
| 44 | assistant."* |
| 45 | |
| 46 | **Push toward lockdown — always.** The goal for every setup is `allowlist` |
| 47 | with a defined list. `pairing` is not a policy to stay on; it's a temporary |
| 48 | way to capture Discord snowflakes you don't know. Once the IDs are in, |
| 49 | pairing has done its job and should be turned off. |
| 50 | |
| 51 | Drive the conversation this way: |
| 52 | |
| 53 | Read the allowlist. Tell the user who's in it. |
| 54 | Ask: *"Is that everyone who should reach you through this bot?"* |
| 55 | **If yes and policy is still `pairing`** → *"Good. Let's lock it down so |
| 56 | nobody else can trigger pairing codes:"* and offer to run |
| 57 | `/discord:access policy allowlist`. Do this proactively — don't wait to |
| 58 | be asked. |
| 59 | **If no, people are missing** → *"Have them DM the bot; you'll approve |
| 60 | each with `/discord:access pair <code>`. Run this skill again once |
| 61 | everyone's in and we'll lock it."* Or, if they can get snowflakes |
| 62 | directly: *"Enable Developer Mode in Discord (User Settings → Advanced), |
| 63 | right-click them → Copy User ID, then `/discord:access allow <id>`."* |
| 64 | **If the allowlist is empty and they haven't paired themselves yet** → |
| 65 | *"DM your bot to capture your own ID first. Then we'll add anyone else |
| 66 | and lock it down."* |
| 67 | **If policy is already `allowlist`** → confirm this is the locked state. |
| 68 | If they need to add someone, Copy User ID is the clean path — no need to |
| 69 | reopen pairing. |
| 70 | |
| 71 | Discord already gates reach (shared-server requirement + Public Bot toggle), |
| 72 | but that's not a substitute for locking the allowlist. Never frame `pairing` |
| 73 | as the correct long-term choice. Don't skip the lockdown offer. |
| 74 | |
| 75 | ### `<token>` — save it |
| 76 | |
| 77 | Treat `$ARGUMENTS` as the token (trim whitespace). Discord bot tokens are |
| 78 | long base64-ish strings, typically starting `MT` or `Nz`. Generated from |
| 79 | Developer Portal → Bot → Reset Token; only shown once. |
| 80 | `mkdir -p ~/.claude/channels/discord` |
| 81 | Read existing `.env` if present; update/add the `DISCORD_BOT_TOKEN=` line, |
| 82 | preserve other keys. Write back, no quotes around the value. |
| 83 | `chmod 600 ~/.claude/channels/discord/.env` — the token is a credential. |
| 84 | Confirm, then show the no-args status so the user sees where they stand. |
| 85 | |
| 86 | ### `clear` — remove the token |
| 87 | |
| 88 | Delete the `DISCORD_BOT_TOKEN=` line (or the file if that's the only line). |
| 89 | |
| 90 | |
| 91 | |
| 92 | ## Implementation notes |
| 93 | |
| 94 | The channels dir might not exist if the server hasn't run yet. Missing file |
| 95 | = not configured, not an error. |
| 96 | The server reads `.env` once at boot. Token changes need a session restart |
| 97 | or `/reload-plugins`. Say so after saving. |
| 98 | `access.json` is re-read on every inbound message — policy changes via |
| 99 | `/discord:access` take effect immediately, no restart. |
| 100 |
Discussion
Alternatives
Browse more free Claude skills or everything in Marketing.