TLSharp icon indicating copy to clipboard operation
TLSharp copied to clipboard

Add a member to the group

Open khristina91 opened this issue 5 years ago • 1 comments

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);
}

`

khristina91 avatar Jan 21 '20 11:01 khristina91

Use a valid group ID and it would work.

olorunfemidavis avatar Mar 10 '21 14:03 olorunfemidavis