create qr-codes by tg bot
Deploy app frontend / app frontend (push) Failing after 48s
Deploy db-migrations / db-migrations (push) Failing after 35s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Failing after 53s

This commit is contained in:
2024-12-10 13:21:38 +02:00
parent e9b3df38fe
commit 1810c550ba
91 changed files with 3317 additions and 1909 deletions
@@ -0,0 +1,37 @@
import { Bot } from "grammy";
import { MyContext } from "../../types/myContext";
import { bot } from "old_bot"; // Ваш кастомный контекст
/**
* Устанавливает команды для бота.
* @param bot - Экземпляр бота.
*/
export async function setupCommands(bot: Bot<MyContext>): Promise<void> {
// Настройка команд для английского языка (по умолчанию)
await bot.api.setMyCommands([]);
// Настройка команд для русского языка
await bot.api.setMyCommands(
[
{
command: "start",
description: "Запустить бота",
},
{
command: "help",
description: "Получить помощь",
},
{
command: "new",
description: "Создать новый QR-код",
},
{
command: "manage",
description: "Управлять QR-кодами",
},
],
{ language_code: "ru" },
);
console.log("Команды успешно установлены.");
}