telegram-apitdlibwtelegramclient

Reactions count in WTelegramClient


I am trying to implement script that will count reaction count for particular messages.

I already tried using client.Messages_GetMessagesReactions() and it return me 400 MSG_ID_INVALID.

Current not working code part:

Dictionary<MessageBase, int> messages = new();
var step = 0;

while (history.Messages[0].Date >= DateTime.Today.AddDays(-7))
{
    await Task.Delay(500);

    foreach (var message in history.Messages)
    {
        var rec = await client.Messages_GetMessageReactionsList(new InputPeerUser(myself.ID, myself.access_hash), message.ID);
        if (rec.count >= 5)
            list.Add(message);
    }

    step += 20;
    history = await client.Messages_GetHistory(channel, 0, default, step, 0);
}


Solution

  • I figuret it out. Instead of using Messages_GetMessagesReactions() method i cast message (MessageBase class) to Message which have reactions property.