mirror of
https://github.com/anthropics/claude-plugins-official.git
synced 2026-03-22 00:03:09 +00:00
Compare commits
2 Commits
kenneth/ch
...
docs/readm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b01fad3396 | ||
|
|
8908a582f8 |
@@ -47,18 +47,15 @@ These are Claude Code commands — run `claude` to start a session first.
|
|||||||
Install the plugin:
|
Install the plugin:
|
||||||
```
|
```
|
||||||
/plugin install discord@claude-plugins-official
|
/plugin install discord@claude-plugins-official
|
||||||
/reload-plugins
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Check that `/discord:configure` tab-completes. If not, restart your session.
|
|
||||||
|
|
||||||
**5. Give the server the token.**
|
**5. Give the server the token.**
|
||||||
|
|
||||||
```
|
```
|
||||||
/discord:configure MTIz...
|
/discord:configure MTIz...
|
||||||
```
|
```
|
||||||
|
|
||||||
Writes `DISCORD_BOT_TOKEN=...` to `~/.claude/channels/discord/.env`. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence.
|
Writes `DISCORD_BOT_TOKEN=...` to `.claude/channels/discord/.env` in your project. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence.
|
||||||
|
|
||||||
**6. Relaunch with the channel flag.**
|
**6. Relaunch with the channel flag.**
|
||||||
|
|
||||||
@@ -70,7 +67,7 @@ claude --channels plugin:discord@claude-plugins-official
|
|||||||
|
|
||||||
**7. Pair.**
|
**7. Pair.**
|
||||||
|
|
||||||
DM your bot on Discord — it replies with a pairing code. In your assistant session:
|
With Claude Code running from the previous step, DM your bot on Discord — it replies with a pairing code. If the bot doesn't respond, make sure your session is running with `--channels`. In your Claude Code session:
|
||||||
|
|
||||||
```
|
```
|
||||||
/discord:access pair <code>
|
/discord:access pair <code>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
type Attachment,
|
type Attachment,
|
||||||
} from 'discord.js'
|
} from 'discord.js'
|
||||||
import { randomBytes } from 'crypto'
|
import { randomBytes } from 'crypto'
|
||||||
import { readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync, statSync, renameSync, realpathSync, chmodSync } from 'fs'
|
import { readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync, statSync, renameSync, realpathSync } from 'fs'
|
||||||
import { homedir } from 'os'
|
import { homedir } from 'os'
|
||||||
import { join, sep } from 'path'
|
import { join, sep } from 'path'
|
||||||
|
|
||||||
@@ -37,8 +37,6 @@ const ENV_FILE = join(STATE_DIR, '.env')
|
|||||||
// Load ~/.claude/channels/discord/.env into process.env. Real env wins.
|
// Load ~/.claude/channels/discord/.env into process.env. Real env wins.
|
||||||
// Plugin-spawned servers don't get an env block — this is where the token lives.
|
// Plugin-spawned servers don't get an env block — this is where the token lives.
|
||||||
try {
|
try {
|
||||||
// Token is a credential — lock to owner. No-op on Windows (would need ACLs).
|
|
||||||
chmodSync(ENV_FILE, 0o600)
|
|
||||||
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
||||||
const m = line.match(/^(\w+)=(.*)$/)
|
const m = line.match(/^(\w+)=(.*)$/)
|
||||||
if (m && process.env[m[1]] === undefined) process.env[m[1]] = m[2]
|
if (m && process.env[m[1]] === undefined) process.env[m[1]] = m[2]
|
||||||
|
|||||||
@@ -80,8 +80,7 @@ as the correct long-term choice. Don't skip the lockdown offer.
|
|||||||
2. `mkdir -p ~/.claude/channels/discord`
|
2. `mkdir -p ~/.claude/channels/discord`
|
||||||
3. Read existing `.env` if present; update/add the `DISCORD_BOT_TOKEN=` line,
|
3. Read existing `.env` if present; update/add the `DISCORD_BOT_TOKEN=` line,
|
||||||
preserve other keys. Write back, no quotes around the value.
|
preserve other keys. Write back, no quotes around the value.
|
||||||
4. `chmod 600 ~/.claude/channels/discord/.env` — the token is a credential.
|
4. Confirm, then show the no-args status so the user sees where they stand.
|
||||||
5. Confirm, then show the no-args status so the user sees where they stand.
|
|
||||||
|
|
||||||
### `clear` — remove the token
|
### `clear` — remove the token
|
||||||
|
|
||||||
|
|||||||
@@ -27,18 +27,15 @@ These are Claude Code commands — run `claude` to start a session first.
|
|||||||
Install the plugin:
|
Install the plugin:
|
||||||
```
|
```
|
||||||
/plugin install telegram@claude-plugins-official
|
/plugin install telegram@claude-plugins-official
|
||||||
/reload-plugins
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Check that `/telegram:configure` tab-completes. If not, restart your session.
|
|
||||||
|
|
||||||
**3. Give the server the token.**
|
**3. Give the server the token.**
|
||||||
|
|
||||||
```
|
```
|
||||||
/telegram:configure 123456789:AAHfiqksKZ8...
|
/telegram:configure 123456789:AAHfiqksKZ8...
|
||||||
```
|
```
|
||||||
|
|
||||||
Writes `TELEGRAM_BOT_TOKEN=...` to `~/.claude/channels/telegram/.env`. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence.
|
Writes `TELEGRAM_BOT_TOKEN=...` to `.claude/channels/telegram/.env` in your project. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence.
|
||||||
|
|
||||||
**4. Relaunch with the channel flag.**
|
**4. Relaunch with the channel flag.**
|
||||||
|
|
||||||
@@ -50,7 +47,7 @@ claude --channels plugin:telegram@claude-plugins-official
|
|||||||
|
|
||||||
**5. Pair.**
|
**5. Pair.**
|
||||||
|
|
||||||
DM your bot on Telegram — it replies with a 6-character pairing code. In your assistant session:
|
With Claude Code running from the previous step, DM your bot on Telegram — it replies with a 6-character pairing code. If the bot doesn't respond, make sure your session is running with `--channels`. In your Claude Code session:
|
||||||
|
|
||||||
```
|
```
|
||||||
/telegram:access pair <code>
|
/telegram:access pair <code>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
import { Bot, InputFile, type Context } from 'grammy'
|
import { Bot, InputFile, type Context } from 'grammy'
|
||||||
import type { ReactionTypeEmoji } from 'grammy/types'
|
import type { ReactionTypeEmoji } from 'grammy/types'
|
||||||
import { randomBytes } from 'crypto'
|
import { randomBytes } from 'crypto'
|
||||||
import { readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync, statSync, renameSync, realpathSync, chmodSync } from 'fs'
|
import { readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync, statSync, renameSync, realpathSync } from 'fs'
|
||||||
import { homedir } from 'os'
|
import { homedir } from 'os'
|
||||||
import { join, extname, sep } from 'path'
|
import { join, extname, sep } from 'path'
|
||||||
|
|
||||||
@@ -30,8 +30,6 @@ const ENV_FILE = join(STATE_DIR, '.env')
|
|||||||
// Load ~/.claude/channels/telegram/.env into process.env. Real env wins.
|
// Load ~/.claude/channels/telegram/.env into process.env. Real env wins.
|
||||||
// Plugin-spawned servers don't get an env block — this is where the token lives.
|
// Plugin-spawned servers don't get an env block — this is where the token lives.
|
||||||
try {
|
try {
|
||||||
// Token is a credential — lock to owner. No-op on Windows (would need ACLs).
|
|
||||||
chmodSync(ENV_FILE, 0o600)
|
|
||||||
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
for (const line of readFileSync(ENV_FILE, 'utf8').split('\n')) {
|
||||||
const m = line.match(/^(\w+)=(.*)$/)
|
const m = line.match(/^(\w+)=(.*)$/)
|
||||||
if (m && process.env[m[1]] === undefined) process.env[m[1]] = m[2]
|
if (m && process.env[m[1]] === undefined) process.env[m[1]] = m[2]
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ offer.
|
|||||||
2. `mkdir -p ~/.claude/channels/telegram`
|
2. `mkdir -p ~/.claude/channels/telegram`
|
||||||
3. Read existing `.env` if present; update/add the `TELEGRAM_BOT_TOKEN=` line,
|
3. Read existing `.env` if present; update/add the `TELEGRAM_BOT_TOKEN=` line,
|
||||||
preserve other keys. Write back, no quotes around the value.
|
preserve other keys. Write back, no quotes around the value.
|
||||||
4. `chmod 600 ~/.claude/channels/telegram/.env` — the token is a credential.
|
4. Confirm, then show the no-args status so the user sees where they stand.
|
||||||
5. Confirm, then show the no-args status so the user sees where they stand.
|
|
||||||
|
|
||||||
### `clear` — remove the token
|
### `clear` — remove the token
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user