alik0211 / mtproto-core

Telegram API JS (MTProto) client library for Node.js and browser
https://mtproto-core.js.org
GNU General Public License v3.0
631 stars 113 forks source link

Channel message does not get on the update listeners #184

Open alexsanderluisdev opened 3 years ago

alexsanderluisdev commented 3 years ago

I'm registered all update listeners and all the messages sent on specific channel don't appear on them. In another channels, the messages appears on the listeners.

mtproto.updates.on('updates', (updateInfo) => {
    logLibrary.write('updates: ' + JSON.stringify(updateInfo));
});

mtproto.updates.on('updateShortChatMessage', (updateInfo) => {
    logLibrary.write('updateShortChatMessage: ' + JSON.stringify(updateInfo));
});

mtproto.updates.on('updateNewChannelMessage', (updateInfo) => {
    logLibrary.write('updateNewChannelMessage: ' + JSON.stringify(updateInfo));
});

mtproto.updates.on('updateShortMessage', (updateInfo) => {
    logLibrary.write('updateShortMessage: ' + JSON.stringify(updateInfo));
});

mtproto.updates.on('updateShort', (updateInfo) => {
    logLibrary.write('updateShort: ' + JSON.stringify(updateInfo));
});

mtproto.updates.on('updatesTooLong', (updateInfo) => {
    logLibrary.write('updatesTooLong: ' + JSON.stringify(updateInfo));
});

mtproto.updates.on('updatesCombined', (updateInfo) => {
    logLibrary.write('updatesCombined: ' + JSON.stringify(updateInfo));
});

mtproto.updates.on('updateShortSentMessage', (updateInfo) => {
    logLibrary.write('updateShortSentMessage: ' + JSON.stringify(updateInfo));
});

Captura de tela 2021-05-10 145728

Captura de tela 2021-05-10 145846

ffbboy30 commented 3 years ago

Do you make it works , I've the same problem . Events never fire

alexsanderluisdev commented 3 years ago

In my case, the event does not trigger in some groups, but in others it does.

ffbboy30 commented 3 years ago

Now I've made it orking with my test server and some other channel it seems to works properly. The next problem is to filter the message and the channel name to select only the channel I want. Thanks

ccostel commented 3 years ago

Now I've made it orking with my test server and some other channel it seems to works properly. The next problem is to filter the message and the channel name to select only the channel I want. Thanks

How did you manage to fix it? I am having the same issue with some channels.

ffbboy30 commented 3 years ago

Nope, I'm blocked after receiving the message. I don't find the good filter

happymaskterriblefate commented 3 years ago

I'm experiencing this too -- it's very odd. From what I can tell, channel message updates come through for "group chat" style channels without a problem, but if it's a "broadcast" style channel, they don't show up.

I've spun up the updates handlers for another javascript telegram module, gramjs, and I see the updates come through just fine, so it's not an issue with my app or my account.

felipepimsil commented 2 years ago

any fix to this?

Nafidinara commented 2 years ago

I'm experiencing this too -- it's very odd. From what I can tell, channel message updates come through for "group chat" style channels without a problem, but if it's a "broadcast" style channel, they don't show up.

I've spun up the updates handlers for another javascript telegram module, gramjs, and I see the updates come through just fine, so it's not an issue with my app or my account.

Hi @happymaskterriblefate , how do you listen to updates in grams.js?, I don't find any documentation there

IRGC commented 2 years ago

Read here https://painor.gitbook.io/gramjs/getting-started/updates-events

IgorKurkov commented 2 years ago

any updates on this topic? how to receive updates without ugly pulling by updates.getState?