diff --git a/index.ts b/index.ts index 2769b34..42b39c7 100644 --- a/index.ts +++ b/index.ts @@ -178,7 +178,7 @@ function initializeStream() { initializeStream(); }); channel.on("mention", async (e) => { - if (e.text && e.userId !== me.id) { + if (e.text && e.userId !== me.id && !e.user.isBot) { const replyTree = await expandReplyTree(e); console.log(`* push: reply (${e.id}, ${replyTree.length} msgs)`); jobs.push({ type: "reply", id: e.id, replyTree }); @@ -200,8 +200,12 @@ async function runJob() { const job = jobs.pop(); if (job) { console.log(`* pop: ${job.type}`); - await processJob(job); - console.log("* job complete"); + try { + await processJob(job); + console.log("* job complete"); + } catch (e) { + console.log(`* error: ${e}`); + } } await sleep(1000); // 1sec }