mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Upgrade API serialisation code to enable potential context-based serialisation
This commit is contained in:
parent
c80965394d
commit
0f22285824
7 changed files with 149 additions and 144 deletions
|
|
@ -253,6 +253,13 @@ namespace PluralKit
|
|||
if (input.Trim().Length == 0) return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
public static string BoundsCheck(this string input, int maxLength, string nameInError)
|
||||
{
|
||||
if (input != null && input.Length > maxLength)
|
||||
throw new PKParseError($"{nameInError} too long ({input.Length} > {maxLength}).");
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Emojis {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue