fix(MatchRaw commands): don't skip matching flags when setting new value
This commit is contained in:
		@@ -145,7 +145,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var newDisplayName = ctx.RemainderOrNull();
 | 
			
		||||
                var newDisplayName = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
 | 
			
		||||
                var patch = new GroupPatch { DisplayName = Partial<string>.Present(newDisplayName) };
 | 
			
		||||
                await _db.Execute(conn => _repo.UpdateGroup(conn, target.Id, patch));
 | 
			
		||||
@@ -195,7 +195,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var description = ctx.RemainderOrNull().NormalizeLineEndSpacing();
 | 
			
		||||
                var description = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
                if (description.IsLongerThan(Limits.MaxDescriptionLength))
 | 
			
		||||
                    throw Errors.StringTooLongError("Description", description.Length, Limits.MaxDescriptionLength);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var description = ctx.RemainderOrNull().NormalizeLineEndSpacing();
 | 
			
		||||
                var description = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
                if (description.IsLongerThan(Limits.MaxDescriptionLength))
 | 
			
		||||
                    throw Errors.StringTooLongError("Description", description.Length, Limits.MaxDescriptionLength);
 | 
			
		||||
 | 
			
		||||
@@ -147,7 +147,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var pronouns = ctx.RemainderOrNull().NormalizeLineEndSpacing();
 | 
			
		||||
                var pronouns = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
                if (pronouns.IsLongerThan(Limits.MaxPronounsLength))
 | 
			
		||||
                    throw Errors.StringTooLongError("Pronouns", pronouns.Length, Limits.MaxPronounsLength);
 | 
			
		||||
 | 
			
		||||
@@ -385,7 +385,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var newDisplayName = ctx.RemainderOrNull();
 | 
			
		||||
                var newDisplayName = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
 | 
			
		||||
                var patch = new MemberPatch { DisplayName = Partial<string>.Present(newDisplayName) };
 | 
			
		||||
                await _db.Execute(conn => _repo.UpdateMember(conn, target.Id, patch));
 | 
			
		||||
@@ -437,7 +437,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var newServerName = ctx.RemainderOrNull();
 | 
			
		||||
                var newServerName = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
 | 
			
		||||
                var patch = new MemberGuildPatch { DisplayName = newServerName };
 | 
			
		||||
                await _db.Execute(conn => _repo.UpsertMemberGuild(conn, target.Id, ctx.Guild.Id, patch));
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var newSystemName = ctx.RemainderOrNull();
 | 
			
		||||
                var newSystemName = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
 | 
			
		||||
                if (newSystemName.Length > Limits.MaxSystemNameLength)
 | 
			
		||||
                    throw Errors.StringTooLongError("System name", newSystemName.Length, Limits.MaxSystemNameLength);
 | 
			
		||||
@@ -108,7 +108,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var newDescription = ctx.RemainderOrNull()?.NormalizeLineEndSpacing();
 | 
			
		||||
                var newDescription = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
                if (newDescription.Length > Limits.MaxDescriptionLength)
 | 
			
		||||
                    throw Errors.StringTooLongError("Description", newDescription.Length, Limits.MaxDescriptionLength);
 | 
			
		||||
 | 
			
		||||
@@ -193,7 +193,7 @@ namespace PluralKit.Bot
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var newTag = ctx.RemainderOrNull(skipFlags: false);
 | 
			
		||||
                var newTag = ctx.RemainderOrNull(skipFlags: false).NormalizeLineEndSpacing();
 | 
			
		||||
                if (newTag != null)
 | 
			
		||||
                    if (newTag.Length > Limits.MaxSystemTagLength)
 | 
			
		||||
                        throw Errors.StringTooLongError("System tag", newTag.Length, Limits.MaxSystemTagLength);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user