@gonzih/cc-tg 0.3.4 → 0.3.5

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19,7 +19,9 @@ import { unlinkSync } from "fs";
19
19
  import { tmpdir } from "os";
20
20
  import { join } from "path";
21
21
  import { CcTgBot } from "./bot.js";
22
- const LOCK_SOCKET = join(tmpdir(), "cc-tg.sock");
22
+ // Make lock socket unique per bot token so multiple users on the same machine don't collide
23
+ const _tokenHash = Buffer.from(process.env.TELEGRAM_BOT_TOKEN ?? "default").toString("base64").replace(/[^a-z0-9]/gi, "").slice(0, 16);
24
+ const LOCK_SOCKET = join(tmpdir(), `cc-tg-${_tokenHash}.sock`);
23
25
  function acquireLock() {
24
26
  return new Promise((resolve) => {
25
27
  const server = createServer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-tg",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Claude Code Telegram bot — chat with Claude Code via Telegram",
5
5
  "type": "module",
6
6
  "bin": {