From 13bd410bdcbd88c70ce63bb50cb44ffe7f9b8c80 Mon Sep 17 00:00:00 2001 From: pinks Date: Mon, 11 Sep 2023 01:57:42 +0200 Subject: [PATCH] remove from queue when user blocked bot --- tasks/processJobs.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/processJobs.ts b/tasks/processJobs.ts index 46f33c3..a2b05de 100644 --- a/tasks/processJobs.ts +++ b/tasks/processJobs.ts @@ -58,7 +58,9 @@ export async function processJobs(): Promise { ); } await job.delete().catch(() => undefined); + if (!(err instanceof Grammy.GrammyError) || err.error_code !== 403 /* blocked bot */) { await jobStore.create(job.value); + } }) .finally(() => busyWorkers.delete(worker.name)); } catch (err) {