Stickers will crash!
Receiving a sticker will put the bot in an infinite loop. It will error with the offset, never update the offset position and continuously try and fail.
Seems this is a duplicated with your previous issue. Isn't it?
yes, i get this too. was just trying with the debugger to see what was going on and getting the same sticker event just being received over and over from the poll.
is there a workaround way to modify the internal offset +1?
I'm using
this.bot = new TelegramBot(token, {
polling: true
});
// FIXME - same message repeats
bot.on('sticker', function(input) {
console.log("sticker", input);
TelegramAdapter.showFileInfo(input);
});
is there another way to use the service, with polling not webhook?
for example where can we set the value for long polling?
is my understanding that to do that we would call getUpdates
from the app and the app would have to keep track of the offset?
TelegramBot.prototype.getUpdates = function (timeout, limit, offset) {
when using long polling, more events will stream in, so the offset needs to be adjusted on each incoming event, not just when the poll is made?
Thanks for any advice.
this works:
bot.on('message', function(input) {
console.log("message", input);
if (input.sticker) {
TelegramAdapter.showFileInfo(input.sticker, input.chat.id);
}
if (input.photo) {
TelegramAdapter.showPhotoInfo(input.photo, input.chat.id);
}
});
btw related question - is there any way in the telegram UI for getting the file_id for a photo? that was why i had to write that little script above....
With Telegram UI you means Web / Android / iOS client? None of them I think.
Please proceed to issue #36 as it handles this particular bug!
Thanks @Beyondem and @dcsan for your time and effort in this. See you there!