Try to enforce channel limts?

This commit is contained in:
Rory&
2026-02-14 17:44:55 +01:00
parent 6972aa7fb5
commit 642bf1d60b
6 changed files with 32 additions and 4 deletions
@@ -20,4 +20,5 @@ export class ChannelLimits {
maxPins: number = 500;
maxTopic: number = 1024;
maxWebhooks: number = 100;
maxName: number = 32;
}
+4
View File
@@ -28,6 +28,10 @@ export type ErrorList = Record<string, ObjectErrorContent>;
export type ErrorContent = { code: string; message: string };
export type ObjectErrorContent = { _errors: ErrorContent[] };
export function makeObjectErrorContent(code: string, message: string): ObjectErrorContent {
return { _errors: [{ code, message }] };
}
export function FieldErrors(fields: Record<string, { code?: string; message: string }>, errors?: ErrorObject[]) {
const errorObj: ErrorList = {};
for (const [key, { message, code }] of Object.entries(fields)) {