public TelegramBotClientWork(ITelegramBotClient botClient, ChatId currChat) { this.currChat = currChat; this.Messages = null; this.messageBot = new MessageBot(botClient); this.isFirstMessage = true; this.currentWeattherJson = string.Empty; this.requestOfPicure = new HttpRequestOfPicure(); this.requestOfOpenWeatherMap = new HttpRequestOfOpenWeatherMap(); this.currWeatherInfoCodeList = new List <WeatherInfoJson>(); this.messageOldJsom = new Dictionary <DataOfWeatherForPictureType, StringBuilder>(); MessageOldJsomEmpty(); }
void Bot_OnMessage(object sender, MessageEventArgs e) { if (e.Message.Text == null || e.Message.Text.ToLower() != "/gow") { return; } using (TelegramBotClientWork work = new TelegramBotClientWork(botClient, e.Message.Chat)) { MessageBot messageBot = new MessageBot(botClient); messageBot.SendMessage(e.Message.Chat, "я запустился"); work.Start(); } }
public void Dispose() { this.chat = null; this.currChat = null; this.messageBot = null; }