public static async Task ReloadAllGroupMembers() { Dictionary <long, HashSet <long> > _groupMembers = new(); foreach (var info in await BotAPI.GetGroupListAsync()) { _groupMembers.Add(info.Id, new((await BotAPI.GetGroupMemberListAsync(info.Id)).Select(i => i.Id))); } groupMembers = _groupMembers; }
public static async Task <bool> ReloadGroupMembers(long groupID) { if (groupMembers is null) { return(false); } if ((await BotAPI.GetGroupListAsync()).Where(i => i.Id == groupID).Any()) { groupMembers[groupID] = new((await BotAPI.GetGroupMemberListAsync(groupID)).Select(i => i.Id)); return(true); } return(false); }
public static async Task ReloadFriends() => friends = (await BotAPI.GetFriendListAsync()).Select(i => i.Id).ToImmutableHashSet();