forked from pinks/eris
1
0
Fork 0

refactor: move sendChatAction #12

Merged
nameless merged 1 commits from move-sendaction into pr-main 2023-11-10 23:59:31 +00:00
1 changed files with 4 additions and 2 deletions

View File

@ -241,8 +241,6 @@ async function processGenerationJob(
if (progressResponse.data.progress > state.progress) { if (progressResponse.data.progress > state.progress) {
state.progress = progressResponse.data.progress; state.progress = progressResponse.data.progress;
await updateJob({ state: state }); await updateJob({ state: state });
await bot.api.sendChatAction(state.chat.id, "upload_photo", { maxAttempts: 1 })
.catch(() => undefined);
await bot.api.editMessageText( await bot.api.editMessageText(
state.replyMessage.chat.id, state.replyMessage.chat.id,
state.replyMessage.message_id, state.replyMessage.message_id,
@ -298,6 +296,10 @@ async function processGenerationJob(
{ maxAttempts: 1 }, { maxAttempts: 1 },
).catch(() => undefined); ).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)}`); debug(`Generation finished for ${formatUserChat(state)}`);
} }