TLSharp
TLSharp copied to clipboard
GetHistoryAsync() returns max 100 messages
Hey all, i am trying to retrieve message of a channel using TLsharp, i am using "GetHistoryAsync()" method to retrieve the history of the messages in the channel but it gives max 100 last messages although its "limit" override is set to a higher value. and this is the way i am working with it:
TLInputPeerChannel PeerChannel = new TLInputPeerChannel()
{
ChannelId = chat.ID,
AccessHash = (long)chat.AccessHash
};
TLAbsMessages AbsHistory = await frmLogin.Client.GetHistoryAsync(PeerChannel, limit: Limit);
TLChannelMessages History = (TLChannelMessages)AbsHistory;
List<TLAbsMessage> HistoryMessages = History.Messages.ToList();
List<TLMessage> Messages = HistoryMessages.ConvertAll<TLMessage>
(new Converter<TLAbsMessage, TLMessage>(AbsMessageToMessage));
do you have any idea what am I missing here?
Sounds like a restriction of the API.
Use min_id/max_id parameters for pagination: https://core.telegram.org/method/messages.getHistory#parameters