我特意使用Telegram.bot Api
public static Telegram.Bot.TelegramBotClient bot = new Telegram.Bot.TelegramBotClient(token);
此方法必须删除我在其上回复的人,但它不起作用
public static async Task RemoveMembersFromGp() {
while (true) {
int whilecounr = 0;
int offset = 0;
Telegram.Bot.Types.Update[] updates = bot.GetUpdatesAsync(offset).Result;
Console.WriteLine("While Count IS {0}", whilecounr);
Console.WriteLine("Update Count Is : {0}", updates.Count());
Console.WriteLine("*******************************************************");
whilecounr += 1;
foreach (var update in updates) {
offset = update.Id + 1;
Console.WriteLine("Replay Message is :{0}\n Replay Mesage User name {1}", update.Message.ReplyToMessage.Text, update.Message.ReplyToMessage.From.Username);
if (update.Message.ReplyToMessage !=null && update.Message.ReplyToMessage.Text == "/ban") {
var chat_id = update.Message.ReplyToMessage.Chat.Id;
var user_id = update.Message.ReplyToMessage.From.Id;
await bot.KickChatMemberAsync(chat_id, user_id);
}
continue;
}
}
}