From 80d29af1b4d66a94d2a315a7d85aafd57b4a31c1 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Sat, 20 Sep 2025 12:11:08 +0300 Subject: [PATCH] Update registration and welcome features to use mainMenu for replies - Modified the registration feature to replace KEYBOARD_REMOVE with mainMenu in reply messages. - Updated the welcome feature to use mainMenu instead of combining messages for a cleaner response structure. --- apps/bot/src/bot/features/registration.ts | 12 +++++------- apps/bot/src/bot/features/welcome.ts | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/bot/src/bot/features/registration.ts b/apps/bot/src/bot/features/registration.ts index 745de66..4a8f91b 100644 --- a/apps/bot/src/bot/features/registration.ts +++ b/apps/bot/src/bot/features/registration.ts @@ -1,6 +1,6 @@ import { type Context } from '@/bot/context'; import { logHandle } from '@/bot/helpers/logging'; -import { KEYBOARD_REMOVE } from '@/config/keyboards'; +import { KEYBOARD_REMOVE, mainMenu } from '@/config/keyboards'; import { isValidPhoneNumber, normalizePhoneNumber } from '@/utils/phone'; import { CustomersService } from '@repo/graphql/api/customers'; import { RegistrationService } from '@repo/graphql/api/registration'; @@ -50,9 +50,8 @@ feature.on(':contact', logHandle('contact-registration'), async (ctx) => { documentId: customer.documentId, }); - return ctx.reply(ctx.t('msg-phone-saved') + '\n\n' + ctx.t('commands-list'), { - ...KEYBOARD_REMOVE, - parse_mode: 'HTML', + return ctx.reply(ctx.t('msg-phone-saved'), { + reply_markup: mainMenu, }); } @@ -67,9 +66,8 @@ feature.on(':contact', logHandle('contact-registration'), async (ctx) => { documentId, }); - return ctx.reply(ctx.t('msg-phone-saved') + '\n\n' + ctx.t('commands-list'), { - ...KEYBOARD_REMOVE, - parse_mode: 'HTML', + return ctx.reply(ctx.t('msg-phone-saved'), { + reply_markup: mainMenu, }); } catch (error) { return ctx.reply(ctx.t('err-with-details', { error: String(error) })); diff --git a/apps/bot/src/bot/features/welcome.ts b/apps/bot/src/bot/features/welcome.ts index 2f66bff..7bce81f 100644 --- a/apps/bot/src/bot/features/welcome.ts +++ b/apps/bot/src/bot/features/welcome.ts @@ -1,7 +1,6 @@ import { type Context } from '@/bot/context'; import { logHandle } from '@/bot/helpers/logging'; import { KEYBOARD_SHARE_PHONE, mainMenu } from '@/config/keyboards'; -import { combine } from '@/utils/messages'; import { RegistrationService } from '@repo/graphql/api/registration'; import { Composer } from 'grammy'; @@ -17,7 +16,7 @@ feature.command('start', logHandle('command-start'), async (ctx) => { if (customer) { // Пользователь уже зарегистрирован — приветствуем - return ctx.reply(combine(ctx.t('msg-welcome-back', { name: customer.name })), { + return ctx.reply(ctx.t('msg-welcome-back', { name: customer.name }), { reply_markup: mainMenu, }); }