Restrict pk;random to public members
This commit is contained in:
parent
f10685acd4
commit
335f6203cc
@ -65,7 +65,7 @@ namespace PluralKit.Bot.Commands
|
||||
var randGen = new System.Random();
|
||||
//Maybe move this somewhere else in the file structure since it doesn't need to get created at every command
|
||||
|
||||
var members = (await _data.GetSystemMembers(ctx.System)).ToList();
|
||||
var members = (await _data.GetSystemMembers(ctx.System)).Where(m => m.MemberPrivacy == PrivacyLevel.Public).ToList();
|
||||
if (members == null || !members.Any())
|
||||
throw Errors.NoMembersError;
|
||||
var randInt = randGen.Next(members.Count);
|
||||
|
Loading…
Reference in New Issue
Block a user