mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2026-03-03 07:00:53 +01:00
Add debug logs
This commit is contained in:
@@ -91,12 +91,21 @@ export default class BotsManager {
|
|||||||
const webhookInfo = await bot.telegram.getWebhookInfo();
|
const webhookInfo = await bot.telegram.getWebhookInfo();
|
||||||
const previousPendingUpdateCount = this.botsPeddingUpdateCount[state.id] || 0;
|
const previousPendingUpdateCount = this.botsPeddingUpdateCount[state.id] || 0;
|
||||||
|
|
||||||
|
console.log("Check pending updates:", {state, webhookInfo});
|
||||||
|
|
||||||
if (previousPendingUpdateCount !== 0 && webhookInfo.pending_update_count !== 0) {
|
if (previousPendingUpdateCount !== 0 && webhookInfo.pending_update_count !== 0) {
|
||||||
this._setWebhook(bot, state);
|
this._setWebhook(bot, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.botsPeddingUpdateCount[state.id] = webhookInfo.pending_update_count;
|
this.botsPeddingUpdateCount[state.id] = webhookInfo.pending_update_count;
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
Sentry.captureException(e, {
|
||||||
|
extra: {
|
||||||
|
method: "_checkPendingUpdate",
|
||||||
|
state_id: state.id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async _setWebhook(bot: Telegraf, state: BotState): Promise<boolean> {
|
static async _setWebhook(bot: Telegraf, state: BotState): Promise<boolean> {
|
||||||
|
|||||||
Reference in New Issue
Block a user