mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
refactor: consolidate [x]TooLongErrors into StringTooLongError
This commit is contained in:
parent
b9d090d8cf
commit
bae883c11f
6 changed files with 15 additions and 15 deletions
|
|
@ -36,7 +36,8 @@ namespace PluralKit.Bot
|
|||
var memberName = ctx.RemainderOrNull() ?? throw new PKSyntaxError("You must pass a member name.");
|
||||
|
||||
// Hard name length cap
|
||||
if (memberName.Length > Limits.MaxMemberNameLength) throw Errors.MemberNameTooLongError(memberName.Length);
|
||||
if (memberName.Length > Limits.MaxMemberNameLength)
|
||||
throw Errors.StringTooLongError("Member name", memberName.Length, Limits.MaxMemberNameLength);
|
||||
|
||||
// Warn if there's already a member by this name
|
||||
var existingMember = await _db.Execute(c => _repo.GetMemberByName(c, ctx.System.Id, memberName));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue