Fix pending and blocked bots

This commit is contained in:
2022-01-24 22:39:34 +03:00
parent 7a3d70d1f6
commit c8994aa292
2 changed files with 14 additions and 2 deletions

View File

@@ -2,9 +2,15 @@ import { Telegraf, Context } from 'telegraf';
import { BotState } from '@/bots/manager'; import { BotState } from '@/bots/manager';
import env from '@/config';
export async function createBlockedBot(token: string, state: BotState): Promise<Telegraf> { export async function createBlockedBot(token: string, state: BotState): Promise<Telegraf> {
const bot = new Telegraf(token); const bot = new Telegraf(token, {
telegram: {
apiRoot: env.TELEGRAM_BOT_API_ROOT,
}
});
await bot.telegram.deleteMyCommands(); await bot.telegram.deleteMyCommands();

View File

@@ -2,9 +2,15 @@ import { Telegraf, Context } from 'telegraf';
import { BotState } from '@/bots/manager'; import { BotState } from '@/bots/manager';
import env from '@/config';
export async function createPendingBot(token: string, state: BotState): Promise<Telegraf> { export async function createPendingBot(token: string, state: BotState): Promise<Telegraf> {
const bot = new Telegraf(token); const bot = new Telegraf(token, {
telegram: {
apiRoot: env.TELEGRAM_BOT_API_ROOT,
}
});
await bot.telegram.deleteMyCommands(); await bot.telegram.deleteMyCommands();