ilyalatt / Telega

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

Calling GetAdminLog() #37

Closed wasimjee closed 3 years ago

wasimjee commented 3 years ago

Hi,

I am trying but unable to get, please can you help

ilyalatt commented 3 years ago

Hi. Can you describe the problem in the details? Functions.Channels.GetAdminLog has Q (I guess it is a search query so you can leave it empty), MaxId, MinId and Limit for pagination (you can set them to zero), and Channel. To find the channel you can use code like

var contacts = await tg.Contacts.Search("https://t.me/durov");
var channel = contacts.Chats.Choose(Chat.AsChannelTag).HeadOrNone().IfNone(() => throw new Exception("A channel is not found"));
var channelPeer = new InputPeer.ChannelTag(
    channelId: channel.Id,
    accessHash: channel.AccessHash.AssertSome()
);