0

我可以使用 tlsharp 将用户添加到超级组/频道吗?我试过了:

var contacts = new TLVector<TLInputPhoneContact>();
        contacts.Add(new TLInputPhoneContact { FirstName = "xxx", LastName = "xxx", Phone = "xxx" });
        var req = new TLRequestImportContacts()
        {
            Contacts = contacts
        };
        var contact = client.SendRequestAsync<TLImportedContacts>(req).GetAwaiter().GetResult();
4

1 回答 1

0

我尝试过一些这样的想法:

List<TLInputUser> users= new List<TLInputUser>();
foreach (TeleSharp.TL.TLUser user in users)
{
    usuarios.Add(new TLInputUser
    {
       UserId = user.Id,
       AccessHash = user.AccessHash.Value
    });
}

TeleSharp.TL.Channels.TLRequestInviteToChannel r = new TeleSharp.TL.Channels.TLRequestInviteToChannel
{
    Channel = new TLInputChannel
    {
       ChannelId = tlChannel.Id,
       AccessHash = tlChannel.AccessHash.Value
    },
    Users = new TLVector<TLAbsInputUser>(users)
};

但我收到了异常 USER_NOT_MUTUAL_CONTACT。是否有任何其他选项可以将用户添加到组?非常感谢。

于 2021-01-03T16:53:11.310 回答