Closed derodevil closed 2 years ago
You need to make at least one RPC call to authenticate and receive updates. Try to call GetFullUser
for example. Also you can access captured account
variable in the handler. Also Task.Delay(Timeout.Infinite)
should be called after you subscribed to all accounts because it blocks the app forever and you do not want to do it after 1st account subscription only.
Making PRC call resolve the problem. I got the ID and UserId. How can I get User
instance from the UserId
?
Edit:
I resolve this issue by making a call to Telega.Rpc.Dto.Functions.Messages.GetMessages
I login successfully and I am able to send message. I want to listen to the new updates especially incoming text message but it fails, I cannot get update at all. I edited the sample source as follows:
This is the class to listen to the new updates:
Here's the implementation:
The questions are:
TelegramClient
. Can thisclass UpdateListener
accept multipleTelegramClient
instance? If yes, how to recognize if the incoming message from account A or B?