diff --git a/src/auth/telegram-bot-login.ts b/src/auth/telegram-bot-login.ts index 07b8b88..267b5c2 100644 --- a/src/auth/telegram-bot-login.ts +++ b/src/auth/telegram-bot-login.ts @@ -124,12 +124,12 @@ function formatRemaining(expiresAt: Date) { return `${minutes}:${rest}`; } -function loginReplyMarkup(token: string) { +function loginReplyMarkup(token: string, expiresAt: Date) { return { inline_keyboard: [ [ { - text: 'Войти', + text: `${formatRemaining(expiresAt)} Войти`, url: `${config.webAppUrl}?telegram_login=${encodeURIComponent(token)}`, }, ], @@ -138,7 +138,7 @@ function loginReplyMarkup(token: string) { } function loginMessageText(expiresAt: Date) { - return [formatRemaining(expiresAt), '', 'Войти в MapFlow'].join('\n'); + return 'Войти в MapFlow'; } async function sendLoginMessage( @@ -147,7 +147,7 @@ async function sendLoginMessage( token?: string, expiresAt?: Date, ) { - const replyMarkup = token && expiresAt ? loginReplyMarkup(token) : undefined; + const replyMarkup = token && expiresAt ? loginReplyMarkup(token, expiresAt) : undefined; return callTelegram('sendMessage', { chat_id: chatId,