configure by anthropics/claude-plugins-official
npx skills add https://github.com/anthropics/claude-plugins-official --skill configure将机器人令牌写入 ~/.claude/channels/discord/.env 并引导用户了解访问策略。服务器在启动时会读取这两个文件。
传递的参数:$ARGUMENTS
读取两个状态文件,为用户提供完整概览:
~/.claude/channels/discord/.env 中的 DISCORD_BOT_TOKEN。显示已设置/未设置;如果已设置,显示前6个字符(掩码处理)。~/.claude/channels/discord/access.json(文件缺失 = 默认值:dmPolicy: "pairing",空白的允许列表)。显示:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
/discord:configure <token>。"/discord:access pair <code> 批准。"始终推动锁定策略。 每个配置的目标都是拥有明确定义列表的 allowlist。pairing 不是长期策略;它是一种临时方式,用于捕获你未知的 Discord 雪花ID。一旦 ID 录入,配对就完成了它的使命,应该被关闭。
按以下方式引导对话:
pairing → "很好。让我们锁定它,这样其他人就无法触发配对代码:" 并提供运行 /discord:access policy allowlist 的选项。主动执行此操作 — 不要等待被询问。/discord:access pair <code> 批准每个人。等所有人都加入后再次运行此技能,我们将锁定它。" 或者,如果他们能直接获取雪花ID:"在 Discord 中启用开发者模式(用户设置 → 高级),右键点击他们 → 复制用户ID,然后使用 /discord:access allow <id>。"allowlist → 确认这是锁定状态。如果他们需要添加某人,复制用户ID是更简洁的路径 — 无需重新开放配对。Discord 已经限制了可及性(共享服务器要求 + 公开机器人开关),但这不能替代锁定允许列表。永远不要将 pairing 描述为正确的长期选择。不要跳过锁定提议。
<token> — 保存令牌$ARGUMENTS 视为令牌(去除空白字符)。Discord 机器人令牌是长的类 base64 字符串,通常以 MT 或 Nz 开头。从开发者门户 → Bot → Reset Token 生成;仅显示一次。mkdir -p ~/.claude/channels/discord.env;更新/添加 DISCORD_BOT_TOKEN= 行,保留其他键。写回,值周围不加引号。chmod 600 ~/.claude/channels/discord/.env — 令牌是凭据。clear — 移除令牌删除 DISCORD_BOT_TOKEN= 行(或者如果这是唯一行,则删除文件)。
.env。令牌更改需要重启会话或执行 /reload-plugins。保存后请说明。access.json 在每次收到消息时重新读取 — 通过 /discord:access 进行的策略更改立即生效,无需重启。每周安装量
98
仓库
GitHub 星标
14.2K
首次出现
5 天前
安全审计
安装于
claude-code89
gemini-cli82
cursor82
opencode82
codex82
kimi-cli81
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
Read both state files and give the user a complete picture:
Token — check ~/.claude/channels/discord/.env for DISCORD_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:
What next — end with a concrete next step based on state:
/discord:configure <token> with your bot token from the Developer Portal → Bot → Reset Token."/discord:access pair <code>."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:
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./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>."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$ARGUMENTS as the token (trim whitespace). Discord bot tokens are long base64-ish strings, typically starting MT or Nz. Generated from Developer Portal → Bot → Reset Token; only shown once.mkdir -p ~/.claude/channels/discord.env if present; update/add the DISCORD_BOT_TOKEN= line, preserve other keys. Write back, no quotes around the value.chmod 600 ~/.claude/channels/discord/.env — the token is a credential.clear — remove the tokenDelete the DISCORD_BOT_TOKEN= line (or the file if that's the only line).
.env once at boot. Token changes need a session restart or /reload-plugins. Say so after saving.access.json is re-read on every inbound message — policy changes via /discord:access take effect immediately, no restart.Weekly Installs
98
Repository
GitHub Stars
14.2K
First Seen
5 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code89
gemini-cli82
cursor82
opencode82
codex82
kimi-cli81
OpenClaw 安全 Linux 云部署指南:私有优先、SSH隧道、Podman容器化
40,100 周安装