【问题标题】:TLsharp add user to gorup / channel telegramTLsharp 将用户添加到组/频道电报
【发布时间】:2021-01-04 00:53:11
【问题描述】:

我可以使用 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();

【问题讨论】:

    标签: c# telegram-bot tlsharp


    【解决方案1】:

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

    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-04-08
      • 2016-09-08
      • 2022-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-11
      • 2018-06-11
      相关资源
      最近更新 更多