From a73b0502f5c9b6aa44b40b2b5b60175487f84b69 Mon Sep 17 00:00:00 2001 From: nameless Date: Fri, 10 Nov 2023 10:21:35 +0000 Subject: [PATCH] refactor: move sendChatAction resolves pinks/eris#18 --- app/generationQueue.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/generationQueue.ts b/app/generationQueue.ts index 43cc106..318a622 100644 --- a/app/generationQueue.ts +++ b/app/generationQueue.ts @@ -241,8 +241,6 @@ async function processGenerationJob( if (progressResponse.data.progress > state.progress) { state.progress = progressResponse.data.progress; await updateJob({ state: state }); - await bot.api.sendChatAction(state.chat.id, "upload_photo", { maxAttempts: 1 }) - .catch(() => undefined); await bot.api.editMessageText( state.replyMessage.chat.id, state.replyMessage.message_id, @@ -298,6 +296,10 @@ async function processGenerationJob( { maxAttempts: 1 }, ).catch(() => undefined); + // send upload photo action + await bot.api.sendChatAction(state.chat.id, "upload_photo", { maxAttempts: 1 }) + .catch(() => undefined); + debug(`Generation finished for ${formatUserChat(state)}`); }