I'm currently attempting to make use of incoming "updates" messages from telegram, and finding no examples for this.
Specifically, nothing in the toplevel readme, nor any of the files under the examples/ dir, show anything about, for example, how to react to an incoming UpdateShortChatMessage which contains a newly-received message in a chat.
By sourcediving, I do see that the toplevel MTProto appears to have a pair of on+emit methods, assigned by the constructor in lib/service/main/index.js itself but this exercise in reading the source hasn't so far lead me to discover what event names might be emitted, that I could register an interest in, nor what the shape of arguments they'd provide.
For reference, this is part of a code rewrite on matrix-appservice-tg to swap from using telegram.link to telegram-mtproto; the part of code currently in question starts with the call to client.registerOnUpdates at
I'm currently attempting to make use of incoming "updates" messages from telegram, and finding no examples for this.
Specifically, nothing in the toplevel readme, nor any of the files under the
examples/
dir, show anything about, for example, how to react to an incomingUpdateShortChatMessage
which contains a newly-received message in a chat.By sourcediving, I do see that the toplevel
MTProto
appears to have a pair ofon
+emit
methods, assigned by the constructor inlib/service/main/index.js
itself but this exercise in reading the source hasn't so far lead me to discover what event names might be emitted, that I could register an interest in, nor what the shape of arguments they'd provide.For reference, this is part of a code rewrite on
matrix-appservice-tg
to swap from usingtelegram.link
totelegram-mtproto
; the part of code currently in question starts with the call toclient.registerOnUpdates
athttps://github.com/matrix-org/matrix-appservice-tg/blob/master/lib/TelegramGhost.js#L81