static void Main() { Client = new TelegramBotClient("1050115445:AAFMHnHtznwJNdwZtQ_J0kKF6iqZ8K9EnX4"); XMLmanager.ReadFile(users); Client.OnMessage += Command_Handler; Client.OnCallbackQuery += Keyboard_Handler; Client.StartReceiving(); bool truth = true; while (truth) { string str = Console.ReadLine(); string[] com = str.Split(" "); switch (com[0]) { case "send": Client.SendTextMessageAsync(com[1], com[2]); break; case "exit": truth = false; break; } } Client.StopReceiving(); }
static void Main() { Client = new TelegramBotClient("1050115445:AAFMHnHtznwJNdwZtQ_J0kKF6iqZ8K9EnX4"); XMLmanager.ReadFile(users); Client.OnMessage += FirstCommand; Client.OnCallbackQuery += Keyboard_Handler; Client.StartReceiving(); Console.ReadKey(true); Client.StopReceiving(); }