1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-24 22:46:41 +07:00

fallback for no recorded requests

This commit is contained in:
Fedor Katurov 2021-05-28 15:20:08 +07:00
parent f3e0062033
commit 4492ecfb72

View file

@ -37,7 +37,13 @@ export class TelegramApi {
return;
}
const { body, createdAt } = await this.db.popRequest();
const request = await this.db.popRequest();
if (!request) {
await ctx.reply(`sorry, no logged requests yet`);
return next();
}
const { body, createdAt } = request;
const source = JSON.stringify(body, null, 2);
await ctx.replyWithDocument(