zerobias / telegram-mtproto

Telegram client api (MTProto) library
MIT License
617 stars 136 forks source link

incoming messages from subscribed channels #174

Closed manylov closed 6 years ago

manylov commented 6 years ago

Hi, what is the way to receive messages? can't find any info

Novpic commented 6 years ago

version 3.1.3 Im using this listener for receiving the updates... client.bus.untypedMessage.observe( (data)=>{} ); here i check if in data.message have updates or update then if it the update or updates has this attribute _:updateChannelMessageViews this one shows that there is a new message in a channel and shows the channel id and the message id then i call

client("channels.getMessages",{channel: {_: 'inputPeerChannel', channel_id:THECHANNELID ,access_hash: 'YOURHASH'}, id:[MESSAGEID] });

this do a request and then the way of accessing this request is by catching it by this other listener at the same level of the first client.bus.untypedMessage.observe()

client.bus.rpcResult.observe((data)=>{ console.log(data) });

this is suppose to work, but right now i have some issues calling the client request inside the first listener, this will help you a little.

IF SOMEONE CAN HELP US BOUTH IT WILL BE GREAT :)

goodmind commented 6 years ago

Duplicate of #40