sochix / TLSharp

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

Add a member to the group #895

Open khristina91 opened 4 years ago

khristina91 commented 4 years ago

hi there please guide me I want to add members of one group to another I am a member of both groups I got the first group members and got their Id and AccessHash I use the following code but returns the following error "CHAT_ID_INVALID"

` private async Task AddUserToChannel(TelegramClient client, TLUser user, int channel_id) { //channel_id is the destination group

  var request = new TLRequestAddChatUser
  {
    ChatId = channel_id,
    UserId = new TLInputUser() { UserId = user.Id, AccessHash = user.AccessHash.Value },
    FwdLimit = 100
  };

  TLAbsUpdates updates = await client.SendRequestAsync<TLAbsUpdates>(request);
}

`

olorunfemidavis commented 3 years ago

Use a valid group ID and it would work.