From b293834e3bb6eb5e6f1c97c33d29b6d3212954b4 Mon Sep 17 00:00:00 2001 From: RedRock Date: Wed, 22 May 2024 08:17:38 +0300 Subject: [PATCH] fix: update est-time --- src/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index e543a97..5b7ca30 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,14 +44,17 @@ const main = async () => { let {title, groupName, subject, user, estimatedDate, estimatedTime} = parseMessage(parsed.text) + const estimated = (estimatedDate === undefined && estimatedTime === undefined) + ? `Время выполнения: не указано` + : `Время выполнения: ${estimatedDate} ${estimatedTime}` + const preparedMessage = `📌 Новое обращение: ${title}\n` + `Группа: ${groupName}\n` + `${user}\n` + `${subject}\n` + - (estimatedDate && estimatedTime) - ? `Время выполнения: ${estimatedDate} ${estimatedTime}\n` - : 'Время выполнения: не указано' + `Время выполнения: ${estimated}\n` + if (preparedMessage) { bot.telegram.sendMessage(process.env.TELEGRAM_GROUP_ID, preparedMessage)