Throw syntax error when no argument is given to member rename
This commit is contained in:
parent
f610f88351
commit
9ad16a98ed
@ -63,7 +63,7 @@ namespace PluralKit.Bot.Commands
|
|||||||
if (ctx.System == null) throw Errors.NoSystemError;
|
if (ctx.System == null) throw Errors.NoSystemError;
|
||||||
if (target.System != ctx.System.Id) throw Errors.NotOwnMemberError;
|
if (target.System != ctx.System.Id) throw Errors.NotOwnMemberError;
|
||||||
|
|
||||||
var newName = ctx.RemainderOrNull();
|
var newName = ctx.RemainderOrNull() ?? throw new PKSyntaxError("You must pass a new name for the member.");
|
||||||
|
|
||||||
// Hard name length cap
|
// Hard name length cap
|
||||||
if (newName.Length > Limits.MaxMemberNameLength) throw Errors.MemberNameTooLongError(newName.Length);
|
if (newName.Length > Limits.MaxMemberNameLength) throw Errors.MemberNameTooLongError(newName.Length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user