From 95c9925c943034f3e9c101d373c44769f1be9dcd Mon Sep 17 00:00:00 2001 From: Lorenzo Corallo Date: Sat, 11 Apr 2026 23:31:16 +0200 Subject: [PATCH 1/2] fix: catch in the wrong position in logActionInChat --- src/modules/tg-logger/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/tg-logger/index.ts b/src/modules/tg-logger/index.ts index c589697..108c117 100644 --- a/src/modules/tg-logger/index.ts +++ b/src/modules/tg-logger/index.ts @@ -498,13 +498,14 @@ export class TgLogger extends Module { disable_notification: false, link_preview_options: { is_disabled: true }, }) - .then(after(120_000)) - .then((sent) => this.shared.api.deleteMessage(p.chat.id, sent.message_id)) .catch((error: unknown) => { logger.warn( { error, action: p.action }, "[Moderation:logActionInChat] Failed to post moderation action in chat" ) + return null }) + .then(after(120_000)) + .then((sent) => sent && this.shared.api.deleteMessage(p.chat.id, sent.message_id)) } } From 2e5867742012f789faa7bc80269717a2050c1f6f Mon Sep 17 00:00:00 2001 From: Lorenzo Corallo Date: Sat, 11 Apr 2026 23:34:19 +0200 Subject: [PATCH 2/2] fix: final catch --- src/modules/tg-logger/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/tg-logger/index.ts b/src/modules/tg-logger/index.ts index 108c117..6492afb 100644 --- a/src/modules/tg-logger/index.ts +++ b/src/modules/tg-logger/index.ts @@ -507,5 +507,6 @@ export class TgLogger extends Module { }) .then(after(120_000)) .then((sent) => sent && this.shared.api.deleteMessage(p.chat.id, sent.message_id)) + .catch(() => {}) } }