@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.
- package/dist/notifier.js +7 -1
- 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
|
|
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);
|