public async Task <VkApiCommunity> DiscoverCommunityAsync(string groupId) { VkApiCommunity result = null; try { //"kate_kul" error 100 var groupInfo = await UserApi.Groups.GetByIdAsync(null, groupId, GroupsFields.All); if (groupInfo.Count == 1) { VkApiCommunity community = new VkApiCommunity(this, groupInfo[0]); if (Communities.FirstOrDefault(c => c.Id == community.Id) == null) { Communities.Add(community); } result = community; } } catch (ParameterMissingOrInvalidException) { Console.WriteLine("Error discovering community " + groupId + ": community not found."); } catch (Exception e) { Console.WriteLine("Error discovering community " + groupId + ": " + e); } return(result); }
public async Task <List <VkApiCommunity> > DiscoverCommunities(List <string> communityIds) { List <VkApiCommunity> result = new List <VkApiCommunity>(); foreach (string id in communityIds) { VkApiCommunity community = await DiscoverCommunityAsync(id); if (community != null) { result.Add(community); } } return(result); }
public async Task <VkApiCommunity> GetCommunityAsync(string commId) { VkApiCommunity result = null; VkApiCommunity community = await DiscoverCommunityAsync(commId); if (community != null) { await community.GetDetails(); if (community.Users.Count > 0) { result = community; } } return(result); }