From d700e4c8fa0495ac2ad557bb0dfdb2c45b036fa1 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 6 Apr 2021 04:05:31 +0200 Subject: [PATCH] :bug: fix guild schema --- src/schema/Guild.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/schema/Guild.ts b/src/schema/Guild.ts index 489c37ff..d8c3431d 100644 --- a/src/schema/Guild.ts +++ b/src/schema/Guild.ts @@ -1,13 +1,22 @@ +import { ChannelSchema, GuildChannel } from "fosscord-server-util"; import { Length } from "../util/instanceOf"; export const GuildCreateSchema = { - name: new Length(String, 2, 100), // ! 2-100 chars + name: new Length(String, 2, 100), $region: String, // auto complete voice region of the user + $icon: String, + $channels: [Object], + $guild_template_code: String, + $system_channel_id: BigInt, }; export interface GuildCreateSchema { name: string; region?: string; + icon?: string; + channels?: GuildChannel[]; + guild_template_code?: string; + system_channel_id?: bigint; } export const GuildUpdateSchema = { @@ -26,17 +35,17 @@ export const GuildUpdateSchema = { $afk_timeout: Number, $afk_channel_id: BigInt, }; +// @ts-ignore +delete GuildUpdateSchema.$channels; -export interface GuildUpdateSchema extends GuildCreateSchema { +export interface GuildUpdateSchema extends Omit { banner?: string; splash?: string; description?: string; features?: [string]; - icon?: string; verification_level?: number; default_message_notifications?: number; system_channel_flags?: number; - system_channel_id?: bigint; explicit_content_filter?: number; public_updates_channel_id?: bigint; afk_timeout?: number;