简体   繁体   English

使用Bot获取加入我的电报频道的用户的chatID

[英]Getting the chatID of the user who joins my telegram channel using Bot

I want to find out the chatID or username of the the new user who joins my telegram channel where my telegram bot is one of its admins. 我想找出加入我的电报频道的新用户的chatID或用户名,我的电报机器人是其中的一名管理员。

Also I want to know whether I can get the users list of my channel using my bot admin or not? 我也想知道我是否可以使用我的机器人管理员获取频道的用户列表?

Let say that I'm using NetTelegramBotApi in C#, I have tried the below code but didn't worked: 可以说我在C#中使用NetTelegramBotApi,我尝试了以下代码,但没有成功:

if (update.ChannelPost.NewChatMember != null)
{
Console.WriteLine(update.ChannelPost.NewChatMember.Id.ToString());
continue;
}

Unfortunately the official bot API doesn't have service messages for when a user joins a channel yet. 不幸的是,当用户加入频道时,官方的bot API 还没有服务消息。 However i would like to pint you towards PWRTelegram , which is an unofficial telegram API that allows lots of cool stuff and also allows fetching mtproto updates as a bot (Sounds impossible? well it does it). 但是,我想向您介绍PWRTelegram ,它是一个非官方的电报API,它可以提供很多不错的功能,还可以作为bot来获取mtproto更新(听起来是不可能的?做得很好)。 Chances are you may find a solution with it. 您可能会找到解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM