mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 06:47:56 +00:00
feat: don't try to match other systems' members in switch / group add commands
This commit is contained in:
parent
dec228d5bd
commit
a2bf70b395
4 changed files with 22 additions and 17 deletions
|
|
@ -104,14 +104,12 @@ namespace PluralKit.Bot
|
|||
while (ctx.HasNext())
|
||||
{
|
||||
// and attempt to match a member
|
||||
var member = await ctx.MatchMember();
|
||||
var member = await ctx.MatchMember(restrictToSystem);
|
||||
|
||||
if (member == null)
|
||||
// if we can't, big error. Every member name must be valid.
|
||||
throw new PKError(ctx.CreateMemberNotFoundError(ctx.PopArgument()));
|
||||
|
||||
if (restrictToSystem != null && member.System != restrictToSystem)
|
||||
throw Errors.NotOwnMemberError; // TODO: name *which* member?
|
||||
|
||||
members.Add(member); // Then add to the final output list
|
||||
}
|
||||
if (members.Count == 0) throw new PKSyntaxError($"You must input at least one member.");
|
||||
|
|
@ -127,7 +125,7 @@ namespace PluralKit.Bot
|
|||
while (ctx.HasNext())
|
||||
{
|
||||
// and attempt to match a group
|
||||
var group = await ctx.MatchGroup();
|
||||
var group = await ctx.MatchGroup(restrictToSystem);
|
||||
if (group == null)
|
||||
// if we can't, big error. Every group name must be valid.
|
||||
throw new PKError(ctx.CreateGroupNotFoundError(ctx.PopArgument()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue