I have a program developed by Tlsharp and I want joining channel that I have its channel_id, but for joining channels I need channel_id and access_hash for TLRequestJoinChannel
request.
So I need to get access_hash from channel_id.
Can anybody help me to solve this problem?
this code works 100% :-)
var channelInfo = (await client.SendRequestAsync<TeleSharp.TL.Contacts.TLResolvedPeer>(
new TeleSharp.TL.Contacts.TLRequestResolveUsername
{
username = "ChannelID"
}).ConfigureAwait(false)).chats.lists[0] as TeleSharp.TL.TLChannel;
var Request = new TeleSharp.TL.Channels.TLRequestJoinChannel()
{
channel = new TLInputChannel
{
channel_id = channelInfo.id,
access_hash = (long) channelInfo.access_hash
}
};
try
{
var Respons = await client.SendRequestAsync<Boolean>(Request);
}
catch (exception ex)
{
// Do stuff
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With