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.
This commit is contained in:
parent
d191be03e8
commit
80d29af1b4
@ -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) }));
|
||||
|
||||
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user