sochix / TLSharp

Telegram client library implemented in C#
1.01k stars 380 forks source link

How invite user in Private Chat/Group? #872

Open Linnni opened 5 years ago

Linnni commented 5 years ago

Example: https://t.me/joinchat/23FBskBZfghpoxV9kuUBw invite link.

string GHash = "23FBskBZfghpoxV9kuUBw"; TLRequestCheckChatInvite RCHI = new TLRequestCheckChatInvite(); RCHI.Hash = GHash; TLChatInviteAlready chat = await client.SendRequestAsync<TLChatInviteAlready>(RCHI); TLChat cccc = (TLChat)chat.Chat;

This code give me TLChat obj. I know this method: var r = new TLRequestInviteToChannel { Channel = new TLInputChannel { AccessHash = channel.AccessHash.Value, ChannelId = channel.Id}, Users = Users1}; He it allows you to invite a list of users to a public channel ( TLChannel ). But how can I invite them to TLChat?

Gawiga commented 4 years ago

Well, you could send a message to them with a link from the Chat... You can do this using TLRequestGetFullChat You also can add them to a group, using TLRequestCreateChat putting the users in a Vector, but this would be without an invitation... 😑