@gonzih/cc-discord 0.2.10 → 0.2.12

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/notifier.js +7 -1
  2. package/package.json +1 -1
package/dist/notifier.js CHANGED
@@ -47,6 +47,9 @@ export function parseNotification(raw) {
47
47
  let isCron = false;
48
48
  try {
49
49
  const parsed = JSON.parse(raw);
50
+ // Drop cron-fire pings (⏰ …) — job completion notifications (✅/❌) still pass through
51
+ if (parsed.is_cron === true && parsed.text?.startsWith("⏰"))
52
+ return null;
50
53
  // routing: absent/empty → all transports; non-empty → only listed transports
51
54
  if (parsed.routing && parsed.routing.length > 0 && !parsed.routing.includes("discord")) {
52
55
  return null;
@@ -208,9 +211,12 @@ export function startNotifier(bot, notifyChannelId, namespace, redis, handleUser
208
211
  const buf = metaAgentBuffers.get(ns);
209
212
  if (!buf || !buf.text.trim())
210
213
  return;
211
- const text = `← [${ns}] ` + stripAnsi(buf.text.trim());
214
+ const rawText = stripAnsi(buf.text.trim());
212
215
  buf.text = "";
213
216
  buf.timer = null;
217
+ if (rawText.length < 20)
218
+ return;
219
+ const text = `← [${ns}] ` + rawText;
214
220
  // During an active loop, route meta-agent output to the thread rather than main channel
215
221
  const deliverTo = bot.getLoopThreadId(targetChannelId) ?? targetChannelId;
216
222
  const chunks = splitLongMessage(text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-discord",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Claude Code Discord bot — chat with Claude Code via Discord",
5
5
  "type": "module",
6
6
  "bin": {