如何使用 TLSharp 在 Telegram 频道中添加用户? [英] How I can add users in Telegram channels using TLSharp?

查看:38
本文介绍了如何使用 TLSharp 在 Telegram 频道中添加用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用 TLSharp 创建新频道,但如何将用户添加到此频道?

I know how to create a new channel using TLSharp, but how I can add users to this channel?

推荐答案

用 client.SendRequestAsync 替换 SendRequestAsync 所以:

replace SendRequestAsync with client.SendRequestAsync so :

public async Task<TLUpdates> InviteUserToChannel(TLAbsInputUser user, TLInputChannel channelid)
    {
        TLVector<TLAbsInputUser> u = new TLVector<TLAbsInputUser>();
        u.lists.Add(user);
        var req = new TLRequestInviteToChannel()
        {
            channel = channelid,
            users = u
        };
        var update = await client.SendRequestAsync<TLUpdates>(req);
        return update;
    }

这篇关于如何使用 TLSharp 在 Telegram 频道中添加用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆