cord-bot 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,11 @@ A Discord bot that connects to Claude Code CLI, plus a Claude Code skill that le
6
6
 
7
7
  [![npm version](https://badge.fury.io/js/cord-bot.svg)](https://www.npmjs.com/package/cord-bot)
8
8
 
9
+ <p align="center">
10
+ <img src="docs/screenshot-channel.png" alt="Channel view with thread status" width="300" />
11
+ <img src="docs/screenshot-thread.png" alt="Thread with rich embeds" width="300" />
12
+ </p>
13
+
9
14
  ## What You Get
10
15
 
11
16
  **Discord Bot** — @mention the bot in Discord, it spawns Claude Code to respond. Conversations happen in threads with full context preserved across messages.
@@ -55,7 +60,7 @@ cord start
55
60
  5. Click **Reset Token** → Copy the token (this is your `DISCORD_BOT_TOKEN`)
56
61
  6. Go to **OAuth2** → **URL Generator**:
57
62
  - Scopes: `bot`
58
- - Bot Permissions: `Send Messages`, `Create Public Threads`, `Send Messages in Threads`, `Read Message History`
63
+ - Bot Permissions: `Send Messages`, `Create Public Threads`, `Send Messages in Threads`, `Read Message History`, `Add Reactions`
59
64
  7. Copy the generated URL → Open in browser → Invite bot to your server
60
65
 
61
66
  **Note:** This runs 100% locally. The bot connects *outbound* to Discord's gateway - no need to expose ports or use ngrok.
@@ -99,10 +104,16 @@ cord reply <channel> <msgId> "reply" # Reply to message
99
104
  cord react <channel> <msgId> "emoji" # Add reaction
100
105
  cord thread <channel> <msgId> "name" # Create thread
101
106
  cord rename <threadId> "new name" # Rename thread
107
+ cord state <channel> <msgId> done # Update status (processing, done, error, etc.)
108
+ cord health # Check bot connection status
102
109
  ```
103
110
 
104
111
  See [skills/cord/SKILL.md](./skills/cord/SKILL.md) for full CLI documentation.
105
112
 
113
+ ## Auto-Complete Threads
114
+
115
+ When a user adds a ✅ reaction to the **last message** in a thread, Cord automatically updates the thread starter to "✅ Done". This provides a quick way to signal "conversation complete" without explicit commands.
116
+
106
117
  ## HTTP API
107
118
 
108
119
  Cord also exposes an HTTP API on port 2643 for external scripts and webhooks.
package/bin/cord.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * cord start - Start bot and worker
7
7
  * cord stop - Stop all processes
8
8
  * cord status - Show running status
9
+ * cord health - Check Discord connection
9
10
  * cord setup - Interactive setup wizard
10
11
  *
11
12
  * Discord Commands:
@@ -580,6 +581,26 @@ function isProcessRunning(pid: number): boolean {
580
581
  }
581
582
  }
582
583
 
584
+ async function health() {
585
+ try {
586
+ const response = await fetch(`${API_BASE}/health`);
587
+ const data = await response.json() as { status: string; connected: boolean; user: string };
588
+
589
+ if (data.connected) {
590
+ console.log(`✓ Connected as ${data.user}`);
591
+ } else {
592
+ console.log('✗ Bot not connected to Discord');
593
+ }
594
+ } catch (error: any) {
595
+ if (error.code === 'ECONNREFUSED') {
596
+ console.log('✗ Cannot connect to Cord API. Is the bot running? (cord start)');
597
+ } else {
598
+ console.log(`✗ Error: ${error.message}`);
599
+ }
600
+ process.exit(1);
601
+ }
602
+ }
603
+
583
604
  function showHelp() {
584
605
  console.log(`
585
606
  Cord - Discord to Claude Code bridge
@@ -590,6 +611,7 @@ Management Commands:
590
611
  start Start bot and worker
591
612
  stop Stop all processes
592
613
  status Show running status
614
+ health Check Discord connection
593
615
  setup Interactive setup wizard
594
616
  help Show this help
595
617
 
@@ -675,6 +697,9 @@ switch (command) {
675
697
  case 'setup':
676
698
  setup();
677
699
  break;
700
+ case 'health':
701
+ health();
702
+ break;
678
703
  case 'help':
679
704
  case '--help':
680
705
  case '-h':
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cord-bot",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Discord bot that bridges messages to Claude Code sessions",
5
5
  "repository": {
6
6
  "type": "git",