create qr-codes by tg bot
This commit is contained in:
@@ -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("Команды успешно установлены.");
|
||||
}
|
||||
Reference in New Issue
Block a user