Error when trying to move through months
AguChaves92 opened this issue · 13 comments
So when I press the advance button to go to the next month nothing happens. it loads for a bit but neither the month nor the days change. And when i press it again, the bot simply crashes. Here is the error log:
Also when I press the go back button it changes to january and skips february. And the it gets stuck on january and it cant advance back to march.
Could you show what package options you are using so I can simulate the situation?
Try like this:
bot.on("callback_query", (ctx) => {
if (ctx.callbackQuery.message.message_id == calendar.chats.get(ctx.callbackQuery.message.chat.id)) {
res = calendar.clickButtonCalendar(ctx.callbackQuery);
if (res !== -1) {
ctx.reply("You selected: " + res);
}
}
});
would a video of the behaviour help?
WhatsApp.Video.2023-03-03.at.3.41.11.PM.mp4
this is with the code you passed.
would a video of the behaviour help?
WhatsApp.Video.2023-03-03.at.3.41.11.PM.mp4
this is with the code you passed.
Can you try using a different Telegram Bot Api? I want to understand if the problem will repeat with another API, because I can not reproduce the problem.
The problem is most likely related to slow internet or api.telegram response.
I can't speak for the telegram api, but my internet isn´t as slow as to cause this kind of issues. But I don't know
Could you try using node-telegram-bot-api
or grammy
for testing? This is required to understand if the problem occurs when using other libraries. If the problem does not manifest itself, I will make changes to the package.
Ill try today and see what happens. Ill report back then
@AguChaves92, Are you using type: "module"
? If yes, then at the moment the library does not support ESM
, in the near future I will release an update to work with ESM
.
@AguChaves92, can you try using the following version: npm i telegram-inline-calendar@ecmascript
?
@AguChaves92, If you managed to make everything work, please consider closing this issue.