diff --git a/PluralKit.Bot/Commands/Groups.cs b/PluralKit.Bot/Commands/Groups.cs index 36726056..0fe078e3 100644 --- a/PluralKit.Bot/Commands/Groups.cs +++ b/PluralKit.Bot/Commands/Groups.cs @@ -191,6 +191,8 @@ public class Groups else { var newDisplayName = ctx.RemainderOrNull(false).NormalizeLineEndSpacing(); + if (newDisplayName.Length > Limits.MaxGroupNameLength) + throw new PKError($"Group name too long ({newDisplayName.Length}/{Limits.MaxGroupNameLength} characters)."); var patch = new GroupPatch { DisplayName = Partial.Present(newDisplayName) }; await ctx.Repository.UpdateGroup(target.Id, patch);