mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
add limits to switch members and proxy tag length
This commit is contained in:
parent
52efb3c70a
commit
603123777d
3 changed files with 6 additions and 0 deletions
|
|
@ -40,6 +40,8 @@ namespace PluralKit.Bot
|
|||
// Make sure there are no dupes in the list
|
||||
// We do this by checking if removing duplicate member IDs results in a list of different length
|
||||
if (members.Select(m => m.Id).Distinct().Count() != members.Count) throw Errors.DuplicateSwitchMembers;
|
||||
if (members.Count > Limits.MaxSwitchMemberCount)
|
||||
throw new PKError($"Switch contains too many members ({members.Count} > {Limits.MaxSwitchMemberCount} members).");
|
||||
|
||||
// Find the last switch and its members if applicable
|
||||
await using var conn = await _db.Obtain();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue