ilyalatt / Telega

C# Telegram MTProto Client
https://ilyalatt.github.io/Telega/
MIT License
58 stars 15 forks source link

Newbie's example #60

Closed vuminhquang closed 3 years ago

vuminhquang commented 3 years ago

Hello ilyalatt,

Telega is the most simple way to work with telegram on C#. However, since I am new, could you show me how to use Telega with:

Thank you very much.

Sincerely

ilyalatt commented 3 years ago

Hello. I've checked ListenToUpdates. If there is a new message in a group updateShortChatMessageTag is present. Maybe you want to get new messages from a channel, subscribe to newChannelMessageTag then. If you want to scrape entire message history, look at DownloadChatPictures snippet. To logout use await tg.Call(new LogOut());. There is a bug in Auth, tg.Auth.IsAuthorized stays true even if you logout, so you need to ignore it. If you need a way to check if you're authorized use await tg.Call(new GetFullUser(new InputUser.SelfTag()));. It will throw an exception if you're not authorized.

ilyalatt commented 3 years ago

The library is in a state of change for the simplicity sake. See #57. The latest master is not published to nuget even as preview version yet. I say it to avoid possible confusion :)

vuminhquang commented 3 years ago

Hello :)

Thank you for your reply. I have some feedback. I am admire that you help me some info at this beginning.

Maybe you want to get new messages from a channel

No, I want to get from a group chat. So, where should I look for?

To logout use await tg.Call(new LogOut());

Thank you. Can log out now. After logout, just delete the session file manually -> done

The library is in a state of change for the simplicity sake. See #57. The latest master is not published to nuget even as preview version yet. I say it to avoid possible confusion :)

Yes, I am using the code from master. Thank you for caring 👍 .

ilyalatt commented 3 years ago

No, I want to get from a group chat. So, where should I look for?

ListenToUpdates should print new messages from group chats. I checked it yesterday to be sure. You need to be joined to the group chat. Just launch ListenToUpdates and wait for a new message from somebody.You should get a line in console like updateShortChatMessageTag: ....

vuminhquang commented 3 years ago

I tried:

  1. I joined the group chat
  2. This group chat is very active, they talk every time. So currently I have no clue how to debug. Please see the attachment. CheckFromWeb Console

When debug, it go to "null" image

Thank you

vuminhquang commented 3 years ago

Hello, I update: when I chat 1-1 (not chat in group), telega can get this. But when chat in group, telega receive nothing.

vuminhquang commented 3 years ago

Hello, @ilyalatt this is the channel, sorry, I can't separate channel & group. Thank you very much for your support.