Do not reply to a bot account

This commit is contained in:
2024-12-29 02:25:37 +00:00
parent bb08f5f800
commit 26b4f0ef2c

View File

@@ -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
}