0

I am using follow code:

_clientTelegram.OnUpdate += ListenUpdate;

And Handler of listener updates:

private async Task ListenUpdate(IObject arg)
{
    if (arg is not UpdatesBase updates)
    {
        _logger.LogWarning($"received not UpdatesBase event: {arg.GetType()}");
        return;
    }
    foreach (var update in updates.UpdateList)
        switch (update)
        {
            case UpdateNewMessage unm: await ProcessEventMessage(unm.message); break;
            case UpdateEditMessage uem: await ProcessEventMessage(uem.message); break;
            default: _logger.LogInformation($"handle a type message type: {update.GetType().Name}"); break; 
        }
}

And what names of event, where I undersand that new comment added?

Or on every UpdateEditMessage I have to using await _clientTelegram.Messages_GetReplies(peerChanel, telegramMessageId, limit: MaxRowsComments) ?

Dmitry
  • 327
  • 1
  • 11
  • Have you tried to ask this in [WTelegramClient](https://t.me/WTelegramClient) Telegram group? – Kaneko Qt Oct 27 '22 at 21:24
  • No, I did not know about ones. – Dmitry Oct 28 '22 at 10:46
  • @KanekoQt I prefer people ask their question here rather than the Telegram group, it makes the answer public for other to beneficiate from it. Especially if the question is a general question about the Telegram API rather than a behavior specific to the library – Wizou Oct 28 '22 at 11:49
  • @Wizou, then ask question here and send it to Telegram group for faster reply > profit) – Kaneko Qt Oct 28 '22 at 11:59
  • @KanekoQt you do realize i'm the library author? please don't duplicate your questions on both sites, it waste my time.. – Wizou Oct 28 '22 at 12:47
  • @Wizou, I mean not to duplicate, but send link to question on stackoverflow to Tg chat – Kaneko Qt Oct 28 '22 at 22:06

1 Answers1

0

Channel comments are simply messages posted in the discussion group associated with the channel.

So, the easiest solution would be to join the discussion group, and handle UpdateNewMessage for that group peer.

Wizou
  • 1,336
  • 13
  • 24
  • When I receive event `UpdateNewMessage` how do I undestatand this new message or new comment for message? I already get new messages for channel correct – Dmitry Oct 28 '22 at 12:23
  • You first need to check the Peer ID to determine if it's posted in Channel or in the discussion group. Further, I recommend you to read the official documentation: https://corefork.telegram.org/api/discussion and https://corefork.telegram.org/api/threads – Wizou Oct 28 '22 at 16:55