private void load_lang() { //TranslationHandler.getString("username", "Username :"******"E-Mail:"; } else { label2.Text = TranslationHandler.GetString("username", "Username :"******"accountType", "Account Type:"); //label2.Text = TranslationHandler.getString("username", "Username:"******"password", "Password:"******"locationSettings", "Location Settings"); label7.Text = TranslationHandler.GetString("speed", "Speed:"); label9.Text = TranslationHandler.GetString("moveRadius", "Move Radius:"); label10.Text = TranslationHandler.GetString("meters", "meters"); checkBox1.Text = TranslationHandler.GetString("startFromDefaultLocation", "Start from default location"); groupBox3.Text = TranslationHandler.GetString("botSettings", "Bot Settings"); checkBox2.Text = TranslationHandler.GetString("autoTransferDoublePokemon", "Auto transfer double Pokemons"); label11.Text = TranslationHandler.GetString("maxDupPokemon", "Max. duplicate Pokemons"); label12.Text = TranslationHandler.GetString("maxCPtransfer", "Max. CP to transfer:"); label28.Text = TranslationHandler.GetString("maxIVtransfer", "Max. IV to transfer:"); groupBox8.Text = TranslationHandler.GetString("telegramSettings", "Telegram Settings"); label30.Text = TranslationHandler.GetString("infoline1", "This Bot is absolutely free and open source! Chargeback if you've paid for it!"); label32.Text = TranslationHandler.GetString("infoline2", "Whenever you encounter something related to 'Pokecrot', tell them the Bot is stolen!"); label13.Text = TranslationHandler.GetString("maxPokeballs", "Max. Pokeballs:"); label14.Text = TranslationHandler.GetString("maxGreatballs", "Max. GreatBalls:"); label15.Text = TranslationHandler.GetString("maxUltraballs", "Max. UltraBalls:"); label26.Text = TranslationHandler.GetString("maxMasterballs", "Max. MasterBalls:"); label16.Text = TranslationHandler.GetString("maxRevives", "Max. Revives:"); label27.Text = TranslationHandler.GetString("maxTopRevives", "Max. TopRevives:"); label17.Text = TranslationHandler.GetString("maxPotions", "Max. Potions:"); label18.Text = TranslationHandler.GetString("maxSuperpotions", "Max. SuperPotions:"); label19.Text = TranslationHandler.GetString("maxHyperpotions", "Max. HyperPotions:"); label25.Text = TranslationHandler.GetString("maxToppotions", "Max. TopPotions:"); label20.Text = TranslationHandler.GetString("maxRazzberrys", "Max. RazzBerrys:"); label31.Text = TranslationHandler.GetString("totalCount", "Total Count:"); groupBox5.Text = TranslationHandler.GetString("pokemonNotToTransfer", "Pokemons - Not to transfer"); checkBox4.Text = TranslationHandler.GetString("selectAll", "Select all"); groupBox6.Text = TranslationHandler.GetString("pokemonNotToCatch", "Pokemons - Not to catch"); checkBox5.Text = TranslationHandler.GetString("selectAll", "Select all"); groupBox7.Text = TranslationHandler.GetString("pokemonNotToEvolve", "Pokemons - To envolve"); checkBox6.Text = TranslationHandler.GetString("selectAll", "Select all"); button1.Text = TranslationHandler.GetString("saveConfig", "Save Configuration / Start Bot"); groupBox10.Text = TranslationHandler.GetString("otherSettings", "Other Settings"); checkBox7.Text = TranslationHandler.GetString("useLuckyeggAtEvolve", "Use LuckyEgg at Evolve"); checkBox8.Text = TranslationHandler.GetString("germanPokemonNames", "German Pokemon names"); checkBox9.Text = TranslationHandler.GetString("useIncese", "Use Incense every 30min"); checkBox3.Text = TranslationHandler.GetString("evolvePokemonIfEnoughCandy", "Evolve Pokemons if enough candy"); checkBox10.Text = TranslationHandler.GetString("enablePokemonListGUI", "Enable Pokemon List GUI"); checkBox11.Text = TranslationHandler.GetString("keepPokemonWhichCanBeEvolved", "Keep Pokemons which can be evolved"); chkAutoIncubate.Text = TranslationHandler.GetString("autoIncubate", "Auto incubate"); chkUseBasicIncubators.Text = TranslationHandler.GetString("useBasicIncubators", "Use basic incubators"); }
public void sendInformationText(TelegramUtilInformationTopics topic, params object[] args) { if (_information.ContainsKey(topic) && _information[topic] == true && _informationTopicDefaultTexts.ContainsKey(topic) && _informationTopicDefaultTextIDs.ContainsKey(topic)) { String unformatted = TranslationHandler.GetString(_informationTopicDefaultTextIDs[topic], _informationTopicDefaultTexts[topic]); String formatted = string.Format(unformatted, args); sendMessage(formatted); } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { Globals.acc = comboBox1.SelectedIndex == 0 ? Enums.AuthType.Google : Enums.AuthType.Ptc; if (comboBox1.SelectedIndex == 0) { label2.Text = "E-Mail:"; } else { label2.Text = TranslationHandler.GetString("username", "Username :"); } }
public TelegramUtil(Client client, Telegram.Bot.TelegramBotClient telegram, PokeMaster.Logic.Shared.ISettings settings, Inventory inv) { instance = this; _client = client; _telegram = telegram; _botSettings = settings; _inventory = inv; Array values = Enum.GetValues(typeof(TelegramUtilInformationTopics)); foreach (TelegramUtilInformationTopics topic in values) { _informationDescription[topic] = TranslationHandler.GetString(_informationDescriptionIDs[topic], _informationDescriptionDefault[topic]); _information[topic] = false; } DoLiveStats(settings); DoInformation(); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { Globals.acc = comboBox1.SelectedIndex == 0 ? Enums.AuthType.Google : Enums.AuthType.Ptc; if (comboBox1.SelectedIndex == 0) { label2.Text = "E-Mail:"; // textBox1.Hide(); // label2.Hide(); // textBox2.Hide(); // label3.Hide(); } else { label2.Text = TranslationHandler.GetString("username", "Username :"******"Username:"******"de") * { * label2.Text = "Benutzername:"; * } * else if (languagestr == "spain") * { * label2.Text = "Usuario:"; * } * else if (languagestr == "ptBR") * { * label2.Text = "Usuário:"; * } * else if (languagestr == "tr") * { * label2.Text = "KullaniciAdi:"; * }*/ // textBox1.Show(); // label2.Show(); // textBox2.Show(); // label3.Show(); } }
public async void BotOnMessageReceived(object sender, MessageEventArgs messageEventArgs) { Message message = messageEventArgs.Message; if (message == null || message.Type != MessageType.TextMessage) { return; } _chatid = message.Chat.Id; try { Logger.ColoredConsoleWrite(ConsoleColor.Red, "[TelegramAPI] Got Request from " + message.From.Username + " | " + message.Text); string username = _botSettings.TelegramName; string telegramAnswer = string.Empty; if (username != message.From.Username) { using (System.IO.Stream stream = new System.IO.MemoryStream()) { PokemonGo.RocketAPI.Logic.Properties.Resources.norights.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); stream.Position = 0; await _telegram.SendPhotoAsync(_chatid, new FileToSend("norights.jpg", stream), replyMarkup : new ReplyKeyboardHide()).ConfigureAwait(false); } return; } // [0]-Commando; [1+]-Argument var msgText = message.Text; string[] textCMD = msgText.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); TelegramUtilTask cmd = getTask(textCMD[0]); switch (cmd) { case TelegramUtilTask.UNKNOWN: telegramAnswer = string.Format("Usage:\r\n{0}\r\n{1}\r\n{2}\r\n{3}\r\n{4}\r\n{5}\r\n{6}\r\n{7}\r\n{8}\r\n{9}", @"/stats - Get Current Stats", @"/livestats - Enable/Disable Live Stats", @"/information <topic> - Enable/Disable Information topics", @"/top <HowMany?> - Outputs Top (?) Pokemons", @"/transfer pokemon cp - transfer pokemons that matches with the given data", @"/items - Outputs Items List", @"/drop item amount - Throws the amount of items given", @"/forceevolve - Forces Evolve", @"/snipe pokemon latitude, longitude - snipe desired pokemon", @"/stopbot - stop running bot"); break; case TelegramUtilTask.GET_STATS: var ps = _client.Inventory.GetPlayerStats(); int l = ps.First().Level; long expneeded = ((ps.First().NextLevelXp - ps.First().PrevLevelXp) - StringUtils.getExpDiff(ps.First().Level)); long curexp = ((ps.First().Experience - ps.First().PrevLevelXp) - StringUtils.getExpDiff(ps.First().Level)); double curexppercent = (Convert.ToDouble(curexp) / Convert.ToDouble(expneeded)) * 100; string curloc = _client.CurrentLatitude + "%20" + _client.CurrentLongitude; curloc = curloc.Replace(",", "."); string curlochtml = "https://www.google.com/maps/search/" + curloc + "/"; double shortenLng = Math.Round(_client.CurrentLongitude, 3); double shortenLat = Math.Round(_client.CurrentLatitude, 3); var player = _client.Player.GetPlayer(); telegramAnswer += "\nNickname: " + player.PlayerData.Username; telegramAnswer += "\nLevel: " + ps.First().Level; telegramAnswer += "\nEXP Needed: " + ((ps.First().NextLevelXp - ps.First().PrevLevelXp) - StringUtils.getExpDiff(ps.First().Level)); telegramAnswer += $"\nCurrent EXP: {curexp} ({Math.Round(curexppercent)}%)"; telegramAnswer += "\nEXP to Level up: " + ((ps.First().NextLevelXp) - (ps.First().Experience)); telegramAnswer += "\nKM walked: " + ps.First().KmWalked; telegramAnswer += "\nPokeStops visited: " + ps.First().PokeStopVisits; telegramAnswer += "\nStardust: " + player.PlayerData.Currencies.ToArray()[1].Amount; telegramAnswer += "\nPokemons: " + (_client.Inventory.GetPokemons()).Count() + "/" + player.PlayerData.MaxPokemonStorage; telegramAnswer += "\nItems: " + _client.Inventory.GetItems().Count() + " / " + player.PlayerData.MaxItemStorage; telegramAnswer += "\nCurentLocation:\n" + curlochtml; break; case TelegramUtilTask.GET_TOPLIST: int shows = 10; if (textCMD.Length > 1 && !int.TryParse(textCMD[1], out shows)) { telegramAnswer += $"Error! This is not a Number: {textCMD[1]}\nNevermind...\n"; shows = 10; //TryParse error will reset to 0 } telegramAnswer += "Showing " + shows + " Pokemons...\nSorting..."; await _telegram.SendTextMessageAsync(_chatid, telegramAnswer, replyMarkup : new ReplyKeyboardHide()).ConfigureAwait(false); var myPokemons = _client.Inventory.GetPokemons(); myPokemons = myPokemons.OrderByDescending(x => x.Cp); var PogoUsername = _client.Player.GetPlayer().PlayerData.Username; telegramAnswer = $"Top {shows} Pokemons of {PogoUsername}:"; IEnumerable <PokemonData> topPokemon = myPokemons.Take(shows); foreach (PokemonData pokemon in topPokemon) { telegramAnswer += string.Format("\n{0} | CP: {1} ({2}% perfect)", pokemon.PokemonId, pokemon.Cp, Math.Round(PokemonInfo.CalculatePokemonPerfection(pokemon), 2)); } break; case TelegramUtilTask.SWITCH_LIVESTATS: _livestats = SwitchAndGetAnswer(_livestats, out telegramAnswer, "Live Stats"); break; case TelegramUtilTask.SWITCH_INFORMATION: //_informations = SwitchAndGetAnswer(_informations, out telegramAnswer, "Information"); Array topics = Enum.GetValues(typeof(TelegramUtilInformationTopics)); if (textCMD.Length > 1) { if (textCMD[1] == "all-enable") { foreach (TelegramUtilInformationTopics topic in topics) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); telegramAnswer += "Enabled information topic " + niceName + "\n"; _information[topic] = true; } break; } else if (textCMD[1] == "all-disable") { foreach (TelegramUtilInformationTopics topic in topics) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); telegramAnswer += "Disabled information topic " + niceName + "\n"; _information[topic] = false; } break; } else { foreach (TelegramUtilInformationTopics topic in topics) { if (textCMD[1].ToLower() == topic.ToString().ToLower()) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); _information[topic] = !_information[topic]; telegramAnswer = (_information[topic] ? "En" : "Dis") + "abled information topic " + niceName + "\n"; break; } } } } else { foreach (TelegramUtilInformationTopics topic in topics) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); telegramAnswer += " - " + niceName + "\n"; telegramAnswer += " - " + _informationDescription[topic] + "\n"; telegramAnswer += " - Currently " + (_information[topic] ? "enabled" : "disabled") + "\n"; telegramAnswer += "\n"; } telegramAnswer += " - all-disable\n"; telegramAnswer += " - " + TranslationHandler.GetString("telegram-disable-all", "Disable all topics") + "\n"; telegramAnswer += "\n"; telegramAnswer += " - all-enable\n"; telegramAnswer += " - " + TranslationHandler.GetString("telegram-enable-all", "Enable all topics") + "\n"; telegramAnswer += "\n"; break; } break; case TelegramUtilTask.RUN_FORCEEVOLVE: IEnumerable <PokemonData> pokemonToEvolve = Setout.GetPokemonToEvolve(true); if (pokemonToEvolve.Count() > 3) { Setout.UseLuckyEgg(_client); } foreach (PokemonData pokemon in pokemonToEvolve) { if (_botSettings.pokemonsToEvolve.Contains(pokemon.PokemonId)) { var evolvePokemonOutProto = _client.Inventory.EvolvePokemon((ulong)pokemon.Id); if (evolvePokemonOutProto.Result == POGOProtos.Networking.Responses.EvolvePokemonResponse.Types.Result.Success) { await _telegram.SendTextMessageAsync(_chatid, $"Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExperienceAwarded}xp", replyMarkup : new ReplyKeyboardHide()).ConfigureAwait(false); } else { await _telegram.SendTextMessageAsync(_chatid, $"Failed to evolve {pokemon.PokemonId}. EvolvePokemonOutProto.Result was {evolvePokemonOutProto.Result}, stopping evolving {pokemon.PokemonId}", replyMarkup : new ReplyKeyboardHide()).ConfigureAwait(false); } RandomHelper.RandomSleep(2000); } } telegramAnswer = "Done."; break; case TelegramUtilTask.RUN_SNIPE: telegramAnswer = ProcessSnipeCommand(msgText.Replace(textCMD[0], "").Trim()); break; case TelegramUtilTask.FORCE_STOP: var secs = 1; if (textCMD.Length > 1) { int.TryParse(textCMD[1].Trim(), out secs); } telegramAnswer = $"Stopping bot in {secs} seconds"; await _telegram.SendTextMessageAsync(_chatid, telegramAnswer, replyMarkup : new ReplyKeyboardHide()).ConfigureAwait(false); _telegram.StopReceiving(); RandomHelper.RandomSleep(secs * 1000); Environment.Exit(0); break; case TelegramUtilTask.TRANSFER_POKEMON: telegramAnswer = ProcessTransferPokemon(msgText.Replace(textCMD[0], "").Trim()); break; case TelegramUtilTask.GET_ITEMSLIST: telegramAnswer = ProcessGetItemList(); break; case TelegramUtilTask.DROP_ITEM: telegramAnswer = ProcessDropItem(msgText.Replace(textCMD[0], "").Trim()); break; } await _telegram.SendTextMessageAsync(_chatid, telegramAnswer, replyMarkup : new ReplyKeyboardHide()).ConfigureAwait(false); } catch (Exception ex) { Logger.Debug(ex.ToString()); var apiRequestException = ex as ApiRequestException; if (apiRequestException != null) { await _telegram.SendTextMessageAsync(_chatid, apiRequestException.Message, replyMarkup : new ReplyKeyboardHide()).ConfigureAwait(false); } } }
public async void BotOnMessageReceived(object sender, MessageEventArgs messageEventArgs) { Message message = messageEventArgs.Message; if (message == null || message.Type != MessageType.TextMessage) { return; } _chatid = message.Chat.Id; try { Logger.ColoredConsoleWrite(ConsoleColor.Red, "[TelegramAPI] Got Request from " + message.From.Username + " | " + message.Text); string username = _clientSettings.TelegramName; string telegramAnswer = string.Empty; if (username != message.From.Username) { using (System.IO.Stream stream = new System.IO.MemoryStream()) { Properties.Resources.norights.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); stream.Position = 0; await _telegram.SendPhotoAsync(_chatid, new FileToSend("norights.jpg", stream), replyMarkup : new ReplyKeyboardHide()); } return; } // [0]-Commando; [1+]-Argument string[] textCMD = message.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); TelegramUtilTask cmd = getTask(textCMD[0]); switch (cmd) { case TelegramUtilTask.UNKNOWN: telegramAnswer = string.Format("Usage:\r\n{0}\r\n{1}\r\n{2}\r\n{3}\r\n{4}", @"/stats - Get Current Stats", @"/livestats - Enable/Disable Live Stats", @"/information <topic> - Enable/Disable Information topics", @"/top <HowMany?> - Outputs Top (?) Pokemons", @"/forceevolve - Forces Evolve"); break; case TelegramUtilTask.GET_STATS: var inventory = await _client.Inventory.GetInventory(); var profil = await _client.Player.GetPlayer(); var ps = await _client.Inventory.GetPlayerStats(); int l = ps.First().Level; long expneeded = ((ps.First().NextLevelXp - ps.First().PrevLevelXp) - StringUtils.getExpDiff(ps.First().Level)); long curexp = ((ps.First().Experience - ps.First().PrevLevelXp) - StringUtils.getExpDiff(ps.First().Level)); double curexppercent = (Convert.ToDouble(curexp) / Convert.ToDouble(expneeded)) * 100; string curloc = _client.CurrentLatitude + "%20" + _client.CurrentLongitude; curloc = curloc.Replace(",", "."); string curlochtml = "https://www.google.de/maps/search/" + curloc + "/"; double shortenLng = Math.Round(_client.CurrentLongitude, 3); double shortenLat = Math.Round(_client.CurrentLatitude, 3); string pokemap = shortenLat + ";" + shortenLng; pokemap = pokemap.Replace(",", ".").Replace(";", ","); string pokevishtml = "https://skiplagged.com/pokemon/#" + pokemap + ",14"; telegramAnswer += "\nNickname: " + profil.PlayerData.Username + "\nLevel: " + ps.First().Level + "\nEXP Needed: " + ((ps.First().NextLevelXp - ps.First().PrevLevelXp) - StringUtils.getExpDiff(ps.First().Level)) + $"\nCurrent EXP: {curexp} ({Math.Round(curexppercent)}%)" + "\nEXP to Level up: " + ((ps.First().NextLevelXp) - (ps.First().Experience)) + "\nKM walked: " + ps.First().KmWalked + "\nPokeStops visited: " + ps.First().PokeStopVisits + "\nStardust: " + profil.PlayerData.Currencies.ToArray()[1].Amount + "\nPokemons: " + await _client.Inventory.getPokemonCount() + "/" + profil.PlayerData.MaxPokemonStorage + "\nItems: " + await _client.Inventory.getInventoryCount() + " / " + profil.PlayerData.MaxItemStorage + "\nCurentLocation:\n" + curlochtml + "\nPokevision:\n" + pokevishtml; break; case TelegramUtilTask.GET_TOPLIST: int shows = 10; if (textCMD.Length > 1 && !int.TryParse(textCMD[1], out shows)) { telegramAnswer += $"Error! This is not a Number: {textCMD[1]}\nNevermind...\n"; shows = 10; //TryParse error will reset to 0 } telegramAnswer += "Showing " + shows + " Pokemons...\nSorting..."; await _telegram.SendTextMessageAsync(_chatid, telegramAnswer, replyMarkup : new ReplyKeyboardHide()); var myPokemons = await _inventory.GetPokemons(); myPokemons = myPokemons.OrderByDescending(x => x.Cp); var profile = await _client.Player.GetPlayer(); telegramAnswer = $"Top {shows} Pokemons of {profile.PlayerData.Username}:"; IEnumerable <PokemonData> topPokemon = myPokemons.Take(shows); foreach (PokemonData pokemon in topPokemon) { telegramAnswer += string.Format("\n{0} ({1}) | CP: {2} ({3}% perfect)", pokemon.PokemonId, StringUtils.getPokemonNameGer(pokemon.PokemonId), pokemon.Cp, PokemonInfo.CalculatePokemonPerfection(pokemon)); } break; case TelegramUtilTask.SWITCH_LIVESTATS: _livestats = SwitchAndGetAnswer(_livestats, out telegramAnswer, "Live Stats"); break; case TelegramUtilTask.SWITCH_INFORMATION: //_informations = SwitchAndGetAnswer(_informations, out telegramAnswer, "Information"); Array topics = Enum.GetValues(typeof(TelegramUtilInformationTopics)); if (textCMD.Length > 1) { if (textCMD[1] == "all-enable") { foreach (TelegramUtilInformationTopics topic in topics) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); telegramAnswer += "Enabled information topic " + niceName + "\n"; _information[topic] = true; } break; } else if (textCMD[1] == "all-disable") { foreach (TelegramUtilInformationTopics topic in topics) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); telegramAnswer += "Disabled information topic " + niceName + "\n"; _information[topic] = false; } break; } else { foreach (TelegramUtilInformationTopics topic in topics) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); telegramAnswer = (_information[topic] ? "Dis" : "En") + "abled information topic " + niceName + "\n"; _information[topic] = !_information[topic]; break; } } } else { foreach (TelegramUtilInformationTopics topic in topics) { String niceName = topic.ToString().Substring(0, 1).ToUpper() + topic.ToString().Substring(1).ToLower(); telegramAnswer += " - " + niceName + "\n"; telegramAnswer += " - " + _informationDescription[topic] + "\n"; telegramAnswer += " - Currently " + (_information[topic] ? "enabled" : "disabled") + "\n"; telegramAnswer += "\n"; } telegramAnswer += " - all-disable\n"; telegramAnswer += " - " + TranslationHandler.GetString("telegram-disable-all", "Disable all topics") + "\n"; telegramAnswer += "\n"; telegramAnswer += " - all-enable\n"; telegramAnswer += " - " + TranslationHandler.GetString("telegram-enable-all", "Enable all topics") + "\n"; telegramAnswer += "\n"; break; } break; case TelegramUtilTask.RUN_FORCEEVOLVE: IEnumerable <PokemonData> pokemonToEvolve = await _inventory.GetPokemonToEvolve(null); if (pokemonToEvolve.Count() > 3) { await _inventory.UseLuckyEgg(_client); } foreach (PokemonData pokemon in pokemonToEvolve) { if (_clientSettings.pokemonsToEvolve.Contains(pokemon.PokemonId)) { var evolvePokemonOutProto = await _client.Inventory.EvolvePokemon((ulong)pokemon.Id); if (evolvePokemonOutProto.Result == POGOProtos.Networking.Responses.EvolvePokemonResponse.Types.Result.Success) { await _telegram.SendTextMessageAsync(_chatid, $"Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExperienceAwarded}xp", replyMarkup : new ReplyKeyboardHide()); } else { await _telegram.SendTextMessageAsync(_chatid, $"Failed to evolve {pokemon.PokemonId}. EvolvePokemonOutProto.Result was {evolvePokemonOutProto.Result}, stopping evolving {pokemon.PokemonId}", replyMarkup : new ReplyKeyboardHide()); } await RandomHelper.RandomDelay(1000, 2000); } } telegramAnswer = "Done."; break; } await _telegram.SendTextMessageAsync(_chatid, telegramAnswer, replyMarkup : new ReplyKeyboardHide()); } catch (Exception ex) { if (ex is ApiRequestException) { await _telegram.SendTextMessageAsync(_chatid, (ex as ApiRequestException).Message, replyMarkup : new ReplyKeyboardHide()); } } }