0
How get string value from while loop
private async Task getTelegramMessage() { var bot = new Telegram.Bot.TelegramBotClient("xxxxxx:XXXXXXXXXXXXXXXXXX"); string msg = string.Empty; while (true) { var updates = await bot.GetUpdatesAsync(up++); up = updates[updates.Count() - 1].Id; msg = updates[updates.Count() - 1].Message.Text; } Console.WriteLine(msg); } // I can't get msg value outside loop
2 Respostas
0
Declare a private string above "private async task".
Assign it in the while loop and use it in your code.
0
didn't work