mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix pending and blocked bots
This commit is contained in:
@@ -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();
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user