@gonzih/cc-discord 0.1.5 → 0.1.6
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/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18,10 +18,13 @@
|
|
|
18
18
|
* CWD — working directory for Claude Code (default: process.cwd())
|
|
19
19
|
* DEFAULT_GITHUB_ORG — default GitHub org for #repo routing (default: gonzih)
|
|
20
20
|
*/
|
|
21
|
+
import { createRequire } from "node:module";
|
|
21
22
|
import { Redis } from "ioredis";
|
|
22
23
|
import { CcDiscordBot } from "./bot.js";
|
|
23
24
|
import { startNotifier } from "./notifier.js";
|
|
24
25
|
import { loadTokens } from "./tokens.js";
|
|
26
|
+
const require = createRequire(import.meta.url);
|
|
27
|
+
const { version } = require("../package.json");
|
|
25
28
|
function required(name) {
|
|
26
29
|
const val = process.env[name];
|
|
27
30
|
if (!val) {
|
|
@@ -71,10 +74,10 @@ sharedRedis.on("error", (err) => {
|
|
|
71
74
|
});
|
|
72
75
|
sharedRedis.once("ready", () => {
|
|
73
76
|
// Announce this version on Redis so other services can discover cc-discord
|
|
74
|
-
sharedRedis.set(`cca:meta:cc-discord:version`,
|
|
77
|
+
sharedRedis.set(`cca:meta:cc-discord:version`, version).catch((err) => {
|
|
75
78
|
console.warn("[redis] failed to write version:", err.message);
|
|
76
79
|
});
|
|
77
|
-
console.log(
|
|
80
|
+
console.log(`[cc-discord] version:reported ${version}`);
|
|
78
81
|
});
|
|
79
82
|
// Mutable placeholder closures — filled in once `bot` is created below
|
|
80
83
|
let getLastActiveChannelIdFn = () => undefined;
|