Fix handle update bug

This commit is contained in:
2022-04-01 17:47:41 +03:00
parent 3bf908db32
commit 2b32a94861

View File

@@ -126,6 +126,9 @@ export default class BotsManager {
static async handleUpdate(req: Request, res: Response, next: NextFunction) { static async handleUpdate(req: Request, res: Response, next: NextFunction) {
const botIdStr = req.url.split("/")[1]; const botIdStr = req.url.split("/")[1];
const bot = this.bots[parseInt(botIdStr)]; const bot = this.bots[parseInt(botIdStr)];
if (bot === undefined) return;
await bot.webhookCallback(`/${botIdStr}/${bot.telegram.token}`)(req, res); await bot.webhookCallback(`/${botIdStr}/${bot.telegram.token}`)(req, res);
} }