yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.13k stars 1.49k forks source link

My bot has stopped receiving notifications chat_member, my_chat_member, chat_join_reuest. #1139

Open hailovigor opened 9 months ago

hailovigor commented 9 months ago

Question

Hello!

This is not the first time that my bot has stopped receiving notifications chat_member, my_chat_member, chat_join_reuest. All this is written in getWebhookInfo. Telegram simply does not send this data. It sends messages, sends data about the buttons pressed.

I tried deleting and re-specifying the webhook. Turned it on via polling. But nothing helps. Last time a few hours passed and everything worked by itself. But this is a very long time. My users will eat me up.

hailovigor commented 6 months ago

There was a second site that could duplicate the connection. Reloading the token helped. But disabling the second site helped more :)

bluetyphoon77 commented 5 months ago

Hi @hailovigor I've an issue that is maybe close to yours. Since you solved it and no support is finding why new_chat_members is not working properly, have you maybe any insight about this? Did telegram change something, making events from library unable to work as intended ? Thanks

hailovigor commented 5 months ago

Check getWebhookInfo. Is this event added there?

hailovigor commented 5 months ago

If I insert logs into processing webhook requests, I didn’t have any data there either. This is not a library

bluetyphoon77 commented 5 months ago

@hailovigor Hi Igor thanks for your help. Thanks for your test! Does this mean it did not work for you either to catch new members? So node-telegram-bot is not updated ?

OfirYC commented 5 months ago

i am also receiving this issue actually via other package (grammyJS)

hailovigor commented 5 months ago

This library works fine. But sometimes I get a 429 error for bot authorization and a block for 30 minutes. I have thousands of users, but the bot does not work for so long! I wish I knew the limits and rules so as not to get blocked.

hailovigor commented 5 months ago

Regarding the topic. Check the data in webhook. If the data does not arrive there. Then check GetWebhookInfo. Add the desired event there. If all else fails, create a new token.

OfirYC commented 5 months ago

Regarding the topic. Check the data in webhook. If the data does not arrive there. Then check GetWebhookInfo. Add the desired event there. If all else fails, create a new token.

Actually, i did both - made sure event is listened to via this method + tried to generate a new token (and even a completely new bot). unfortunately it is still inconsistantly sending me these events.

It does feel like some rate limit/rule broken by the bot and also i wish that it was public! i sent a message to Telegram support hopefully they will reply

bluetyphoon77 commented 5 months ago

Regarding the topic. Check the data in webhook. If the data does not arrive there. Then check GetWebhookInfo. Add the desired event there. If all else fails, create a new token.

Actually, i did both - made sure event is listened to via this method + tried to generate a new token (and even a completely new bot). unfortunately it is still inconsistantly sending me these events.

It does feel like some rate limit/rule broken by the bot and also i wish that it was public! i sent a message to Telegram support hopefully they will reply

Hi @OfirYC @hailovigor With your answers I realize I'm not the only one having problem to get this event! Great you sent a message to telegram support but why devs are not doing this themselves, by fixing those issues? Why are they not listening to the community?

Do you know any library that works to get this simple new members event ? Cheers

hailovigor commented 5 months ago

Do you have this error with different bots?

OfirYC commented 5 months ago

Do you have this error with different bots?

Yeap. tried even creating new bot.

OfirYC commented 5 months ago

Regarding the topic. Check the data in webhook. If the data does not arrive there. Then check GetWebhookInfo. Add the desired event there. If all else fails, create a new token.

Actually, i did both - made sure event is listened to via this method + tried to generate a new token (and even a completely new bot). unfortunately it is still inconsistantly sending me these events. It does feel like some rate limit/rule broken by the bot and also i wish that it was public! i sent a message to Telegram support hopefully they will reply

Hi @OfirYC @hailovigor With your answers I realize I'm not the only one having problem to get this event! Great you sent a message to telegram support but why devs are not doing this themselves, by fixing those issues? Why are they not listening to the community?

Do you know any library that works to get this simple new members event ? Cheers

i hope they answer quickyl and shed some light on it, for now it seems like my users will have to suffer for a bit :(

A workaround i am expermiting with right now is accessing update.message.new_chat_members or .left_chat_member.

But i was told that this is wont work in all cases because in super group it wont send it.

do you have telegram? msg me on @perpiepapa maybe we can debug together, because i wanna test on supergroup but having hard time to do it.

bluetyphoon77 commented 5 months ago

Regarding the topic. Check the data in webhook. If the data does not arrive there. Then check GetWebhookInfo. Add the desired event there. If all else fails, create a new token.

Actually, i did both - made sure event is listened to via this method + tried to generate a new token (and even a completely new bot). unfortunately it is still inconsistantly sending me these events. It does feel like some rate limit/rule broken by the bot and also i wish that it was public! i sent a message to Telegram support hopefully they will reply

Hi @OfirYC @hailovigor With your answers I realize I'm not the only one having problem to get this event! Great you sent a message to telegram support but why devs are not doing this themselves, by fixing those issues? Why are they not listening to the community? Do you know any library that works to get this simple new members event ? Cheers

i hope they answer quickyl and shed some light on it, for now it seems like my users will have to suffer for a bit :(

A workaround i am expermiting with right now is accessing update.message.new_chat_members or .left_chat_member.

But i was told that this is wont work in all cases because in super group it wont send it.

do you have telegram? msg me on @perpiepapa maybe we can debug together, because i wanna test on supergroup but having hard time to do it.

Hey 😊👍 Since I'm really beginner, I'm OK to help testing by entering the group, to help you check if event triggers. And when you find the solution please share it then and I'll try to put it in my script 😊 OK I'll write to you. Let's hope devs will fix this asap ....

hailovigor commented 5 months ago

I talked to support . I was asked "is there only one instance running?"

OfirYC commented 5 months ago

I talked to them. I was asked "is there only one instance running?"

why did they ask that? whats the underlying logic? what are they checking exactly? that's too vague to figure out whats going on

hailovigor commented 5 months ago

I had a “transition” from the old bot code to the new one. These are two different sites. I turned on the new site, and threw telegram webhook events on the old one. And it seems that this knocked everything out so that the new token helped. ( Of course, I tried different order of launching the site.)

OfirYC commented 5 months ago

what do you mean by site?

thats not my case anyway, and also Telegram doesnt let u to set up 2 different instances of a single bot afaik

bluetyphoon77 commented 5 months ago

Regarding the topic. Check the data in webhook. If the data does not arrive there. Then check GetWebhookInfo. Add the desired event there. If all else fails, create a new token.

Actually, i did both - made sure event is listened to via this method + tried to generate a new token (and even a completely new bot). unfortunately it is still inconsistantly sending me these events. It does feel like some rate limit/rule broken by the bot and also i wish that it was public! i sent a message to Telegram support hopefully they will reply

Hi @OfirYC @hailovigor With your answers I realize I'm not the only one having problem to get this event! Great you sent a message to telegram support but why devs are not doing this themselves, by fixing those issues? Why are they not listening to the community? Do you know any library that works to get this simple new members event ? Cheers

i hope they answer quickyl and shed some light on it, for now it seems like my users will have to suffer for a bit :(

A workaround i am expermiting with right now is accessing update.message.new_chat_members or .left_chat_member.

But i was told that this is wont work in all cases because in super group it wont send it.

do you have telegram? msg me on @perpiepapa maybe we can debug together, because i wanna test on supergroup but having hard time to do it.

There is still no follow up by the main devs. I'm checking telegraf since this telegram node api is not properly updated and maintained

Sp3rick commented 2 months ago

Hi! seems that node-telegram-bot-api does not automatically add telegram optional updates, i tryed to add it to getUpdates opts in telegramPolling.js (line 137-141) but for some reason does not works, i hope that someone is going to fix this

Currently a workaround is asking telegram again to receive this updates: await bot.setWebHook("",{allowed_updates: JSON.stringify(["message", "edited_channel_post", "callback_query", "message_reaction", "message_reaction_count", "chat_member"])})