diff --git a/src/bot/mtproto-api/workrooms.ts b/src/bot/mtproto-api/workrooms.ts index 2a3ca8a..0b04bb8 100644 --- a/src/bot/mtproto-api/workrooms.ts +++ b/src/bot/mtproto-api/workrooms.ts @@ -214,13 +214,6 @@ export async function reopenChat(context: Context<"issues.reopened", SupportedEv ); } - await mtProto.client.invoke( - new mtProto.api.messages.SendMessage({ - message: "This task has been reopened and this chat has been unarchived.", - peer: new mtProto.api.InputPeerChat({ chatId: chat.chatId }), - }) - ); - // edit ban rights await mtProto.client.invoke( new mtProto.api.messages.EditChatDefaultBannedRights({ @@ -244,6 +237,15 @@ export async function reopenChat(context: Context<"issues.reopened", SupportedEv }) ); + await mtProto.client.invoke( + new mtProto.api.messages.SendMessage({ + message: "This task has been reopened and this chat has been unarchived.", + peer: new mtProto.api.InputPeerChat({ chatId: chat.chatId }), + }) + ); + + + await chats.updateChatStatus("reopened", payload.issue.node_id); return { status: 200, reason: "chat_reopened" }; } catch (er) {