static void Main(string[] args) { Console.WriteLine("Телеграм-бот \"SHARP_POLICE\""); Console.WriteLine("Адресс прокси: " + GetGoodProxy.ParseProxies()); try { Bot.OnMessage += Bot_OnMessage; Bot.OnMessageEdited += Bot_OnMessage; Bot.StartReceiving(); Console.ReadLine(); Bot.StopReceiving(); } catch (Exception e) { Console.WriteLine(e); throw; } }
private static void Bot_OnMessage(object sender, Telegram.Bot.Args.MessageEventArgs e) { if (e.Message.Type == MessageType.TextMessage) { if (e.Message.Text != null) { if (e.Message.Text == "/status") { Bot.SendTextMessageAsync(e.Message.Chat.Id, "Бот работает. Адрес прокси: " + GetGoodProxy.ParseProxies()); } } else { Bot.SendTextMessageAsync(e.Message.Chat.Id, "Bad"); } } }