Enhance Russian localization and add document handling features
- Updated the Russian localization file to include new entries for privacy policy and public offer documents, improving user access to important information. - Added 'documents' command to the bot's command list, allowing users to easily access document-related features. - Integrated document handling in the main menu and handlers, enhancing user experience and navigation within the bot.
This commit is contained in:
parent
8eb2ed8ad7
commit
6d0711c471
@ -45,6 +45,8 @@ commands-list =
|
|||||||
Откройте приложение кнопкой "Открыть", чтобы отредактировать свой профиль или создать запись
|
Откройте приложение кнопкой "Открыть", чтобы отредактировать свой профиль или создать запись
|
||||||
support =
|
support =
|
||||||
{ -support-contact }
|
{ -support-contact }
|
||||||
|
documents =
|
||||||
|
.description = Документы
|
||||||
|
|
||||||
# Кнопки
|
# Кнопки
|
||||||
btn-add-contact = 👤 Добавить контакт
|
btn-add-contact = 👤 Добавить контакт
|
||||||
@ -53,6 +55,7 @@ btn-pro = 👑 Pro доступ
|
|||||||
btn-subscribe = 👑 Приобрести Pro
|
btn-subscribe = 👑 Приобрести Pro
|
||||||
btn-pro-info = ℹ️ Мой Pro доступ
|
btn-pro-info = ℹ️ Мой Pro доступ
|
||||||
btn-open-app = 📱 Открыть приложение
|
btn-open-app = 📱 Открыть приложение
|
||||||
|
btn-documents = 📋 Документы
|
||||||
btn-back = ◀️ Назад
|
btn-back = ◀️ Назад
|
||||||
|
|
||||||
|
|
||||||
@ -67,6 +70,9 @@ share-contact-agreement =
|
|||||||
(Пункт 4.5 <a href='{ $privacyUrl }'>Политики конфиденциальности</a>)</i>
|
(Пункт 4.5 <a href='{ $privacyUrl }'>Политики конфиденциальности</a>)</i>
|
||||||
payment-agreement =
|
payment-agreement =
|
||||||
Совершая оплату, вы соглашаетесь с <a href='{ $offerUrl }'>Публичной офертой</a>
|
Совершая оплату, вы соглашаетесь с <a href='{ $offerUrl }'>Публичной офертой</a>
|
||||||
|
agreement-links =
|
||||||
|
<a href='{ $offerUrl }'>Публичная оферта</a>
|
||||||
|
<a href='{ $privacyUrl }'>Политика конфиденциальности</a>
|
||||||
|
|
||||||
|
|
||||||
# Приветственные сообщения
|
# Приветственные сообщения
|
||||||
|
|||||||
12
apps/bot/src/bot/features/documents.ts
Normal file
12
apps/bot/src/bot/features/documents.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { handleDocuments } from '../handlers/documents';
|
||||||
|
import { type Context } from '@/bot/context';
|
||||||
|
import { logHandle } from '@/bot/helpers/logging';
|
||||||
|
import { Composer } from 'grammy';
|
||||||
|
|
||||||
|
const composer = new Composer<Context>();
|
||||||
|
|
||||||
|
const feature = composer.chatType('private');
|
||||||
|
|
||||||
|
feature.command('documents', logHandle('command-documents'), handleDocuments);
|
||||||
|
|
||||||
|
export { composer as documents };
|
||||||
@ -1,4 +1,5 @@
|
|||||||
export * from './add-contact';
|
export * from './add-contact';
|
||||||
|
export * from './documents';
|
||||||
export * from './help';
|
export * from './help';
|
||||||
export * from './pro';
|
export * from './pro';
|
||||||
export * from './registration';
|
export * from './registration';
|
||||||
|
|||||||
18
apps/bot/src/bot/handlers/documents.ts
Normal file
18
apps/bot/src/bot/handlers/documents.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { type Context } from '@/bot/context';
|
||||||
|
import { env } from '@/config/env';
|
||||||
|
import { KEYBOARD_REMOVE } from '@/config/keyboards';
|
||||||
|
|
||||||
|
async function handler(ctx: Context) {
|
||||||
|
await ctx.reply(
|
||||||
|
ctx.t('agreement-links', {
|
||||||
|
offerUrl: env.OFFER_URL,
|
||||||
|
privacyUrl: env.PRIVACY_URL,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
...KEYBOARD_REMOVE,
|
||||||
|
parse_mode: 'HTML',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { handler as handleDocuments };
|
||||||
@ -1,4 +1,5 @@
|
|||||||
export * from './add-contact';
|
export * from './add-contact';
|
||||||
|
export * from './documents';
|
||||||
export * from './pro';
|
export * from './pro';
|
||||||
export * from './share-bot';
|
export * from './share-bot';
|
||||||
export * from './subscription';
|
export * from './subscription';
|
||||||
|
|||||||
@ -5,7 +5,15 @@ import { type LanguageCode } from '@grammyjs/types';
|
|||||||
import { type Api, type Bot, type RawApi } from 'grammy';
|
import { type Api, type Bot, type RawApi } from 'grammy';
|
||||||
|
|
||||||
export async function setCommands({ api }: Bot<Context, Api<RawApi>>) {
|
export async function setCommands({ api }: Bot<Context, Api<RawApi>>) {
|
||||||
const commands = createCommands(['start', 'addcontact', 'sharebot', 'help', 'subscribe', 'pro']);
|
const commands = createCommands([
|
||||||
|
'start',
|
||||||
|
'addcontact',
|
||||||
|
'sharebot',
|
||||||
|
'help',
|
||||||
|
'subscribe',
|
||||||
|
'pro',
|
||||||
|
'documents',
|
||||||
|
]);
|
||||||
|
|
||||||
for (const command of commands) {
|
for (const command of commands) {
|
||||||
addLocalizations(command);
|
addLocalizations(command);
|
||||||
|
|||||||
@ -1,6 +1,12 @@
|
|||||||
import { env } from './env';
|
import { env } from './env';
|
||||||
import { type Context } from '@/bot/context';
|
import { type Context } from '@/bot/context';
|
||||||
import { handleAddContact, handlePro, handleShareBot, handleSubscribe } from '@/bot/handlers';
|
import {
|
||||||
|
handleAddContact,
|
||||||
|
handleDocuments,
|
||||||
|
handlePro,
|
||||||
|
handleShareBot,
|
||||||
|
handleSubscribe,
|
||||||
|
} from '@/bot/handlers';
|
||||||
import { Menu } from '@grammyjs/menu';
|
import { Menu } from '@grammyjs/menu';
|
||||||
import {
|
import {
|
||||||
type InlineKeyboardMarkup,
|
type InlineKeyboardMarkup,
|
||||||
@ -50,6 +56,8 @@ export const mainMenu = new Menu<Context>('main-menu', { autoAnswer: true })
|
|||||||
.row()
|
.row()
|
||||||
.text((ctx) => ctx.t('btn-share-bot'), handleShareBot)
|
.text((ctx) => ctx.t('btn-share-bot'), handleShareBot)
|
||||||
.row()
|
.row()
|
||||||
|
.text((ctx) => ctx.t('btn-documents'), handleDocuments)
|
||||||
|
.row()
|
||||||
.url(
|
.url(
|
||||||
(ctx) => ctx.t('btn-open-app'),
|
(ctx) => ctx.t('btn-open-app'),
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user