int counter = 0; while (true) // Бесконечный цикл, получение обновлений { crack: try { var s = VkDotNet.Groups.GetLongPollServer(********); var poll = VkDotNet.Groups.GetBotsLongPollHistory( new BotsLongPollHistoryParams() { Server = s.Server, Ts = s.Ts, Key = s.Key, Wait = 25 }); if (poll?.Updates == null) continue; // Проверка на новые события foreach (var upd in poll.Updates) { if (upd.Type == GroupUpdateType.MessageNew) { long? userID = upd.Message.UserId; string userMessage = upd.Message.Body.ToLower(); if (userMessage == "привет" | userMessage == "прив") { SendMessage("Привет", userID); } } counter++; Console.WriteLine($"{counter}: Updates Processed"); } } catch { goto crack; } Code int counter = 0; while (true) // Бесконечный цикл, получение обновлений { crack: try { var s = VkDotNet.Groups.GetLongPollServer(********); var poll = VkDotNet.Groups.GetBotsLongPollHistory( new BotsLongPollHistoryParams() { Server = s.Server, Ts = s.Ts, Key = s.Key, Wait = 25 }); if (poll?.Updates == null) continue; // Проверка на новые события foreach (var upd in poll.Updates) { if (upd.Type == GroupUpdateType.MessageNew) { long? userID = upd.Message.UserId; string userMessage = upd.Message.Body.ToLower(); if (userMessage == "привет" | userMessage == "прив") { SendMessage("Привет", userID); } } counter++; Console.WriteLine($"{counter}: Updates Processed"); } } catch { goto crack; } Вот мой код, но он ловит сообщения только в лс группы, в беседе же , бот назначен админом , но обновления с Long Polla не приходят, как это сделать?
Ты берёшь данные для подключения к сообщениям группы и подключаешься к ним, а потом спрашиваешь почему ЛС у него не работает. Замени группы на сообщения и всё будет работать(по крайней мере у меня в голове работает). Полезные ссылки: https://vknet.github.io/vk/messages/getLongPollServer/ https://vknet.github.io/vk/messages/getLongPollHistory/