claude-telegram-bot 0.3.10 → 0.3.11

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/ctb.mjs +6 -3
  2. package/package.json +1 -1
package/ctb.mjs CHANGED
@@ -133,11 +133,14 @@ function main() {
133
133
  });
134
134
  }
135
135
 
136
- async function summarizeSession(sid) {
136
+ async function summarizeSession(sid, lang) {
137
+ const langInstruction = lang && lang.startsWith("ko")
138
+ ? "한국어로 짧은 구문(10단어 이내)으로 이 세션에서 한 작업을 요약해줘. 마크다운 없이 텍스트만. 중요한 작업이 없으면 정확히 이렇게만 답해: SKIP"
139
+ : "In one short phrase (10 words max), what was done this session? Plain text only. If nothing significant, reply: SKIP";
137
140
  return new Promise((resolve) => {
138
141
  const child = spawn("claude", [
139
142
  "--resume", sid,
140
- "-p", "In one short phrase (10 words max), what was done this session? Plain text only. If nothing significant, reply: SKIP",
143
+ "-p", langInstruction,
141
144
  "--output-format", "json",
142
145
  ], { stdio: ["ignore", "pipe", "ignore"] });
143
146
  let out = "";
@@ -157,7 +160,7 @@ async function notifyTelegram(configPath, sessionId) {
157
160
  try {
158
161
  const cfg = JSON.parse(readFileSync(configPath, "utf8"));
159
162
  if (!cfg.token || !cfg.allowedChatId || cfg.ctbNotify === false) return;
160
- const summary = await summarizeSession(sessionId);
163
+ const summary = await summarizeSession(sessionId, cfg.lang);
161
164
  if (!summary) return;
162
165
  await fetch(`https://api.telegram.org/bot${cfg.token}/sendMessage`, {
163
166
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-telegram-bot",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Drive Claude Code from Telegram — messages run headless `claude -p` in a project dir and replies come back to the chat. Zero dependencies.",
5
5
  "type": "module",
6
6
  "bin": {