I am connecting to the Telegram API with this C # library: TLSharp
There are not enough resources for this library, I'm trying to forward a message to a channel.
I'm not sure how to get the channel peer id message (for input function parameters ahead)
var store = new FileSessionStore(); var client = new TelegramClient(Properties.Settings.Default.apiID, Properties.Settings.Default.apiHash, store, "session"); await client.ConnectAsync(); var dialogs = (TLDialogs)await client.GetUserDialogsAsync(); var chat = dialogs.chats.lists .OfType<TLChannel>() .SingleOrDefault(a=>a.title=="test"); await client.SendRequestAsync<TLAbsUpdates>( new TLRequestForwardMessage() { id = 2, peer = new TLInputPeerChannel() { channel_id = chat.id, access_hash = chat.access_hash.Value }, random_id = Helpers.GenerateRandomLong() });
I get this error message:
{"PEER_ID_INVALID"}
Please help me what peer identifier is and how can I get it and use it to forward a message using TLSharp. Thanks.
source share