1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-22 10:41:34 +02:00

🐛 fix guild schema

This commit is contained in:
Flam3rboy 2021-04-06 04:05:31 +02:00
parent d774216bc8
commit d700e4c8fa

View File

@ -1,13 +1,22 @@
import { ChannelSchema, GuildChannel } from "fosscord-server-util";
import { Length } from "../util/instanceOf"; import { Length } from "../util/instanceOf";
export const GuildCreateSchema = { 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 $region: String, // auto complete voice region of the user
$icon: String,
$channels: [Object],
$guild_template_code: String,
$system_channel_id: BigInt,
}; };
export interface GuildCreateSchema { export interface GuildCreateSchema {
name: string; name: string;
region?: string; region?: string;
icon?: string;
channels?: GuildChannel[];
guild_template_code?: string;
system_channel_id?: bigint;
} }
export const GuildUpdateSchema = { export const GuildUpdateSchema = {
@ -26,17 +35,17 @@ export const GuildUpdateSchema = {
$afk_timeout: Number, $afk_timeout: Number,
$afk_channel_id: BigInt, $afk_channel_id: BigInt,
}; };
// @ts-ignore
delete GuildUpdateSchema.$channels;
export interface GuildUpdateSchema extends GuildCreateSchema { export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels"> {
banner?: string; banner?: string;
splash?: string; splash?: string;
description?: string; description?: string;
features?: [string]; features?: [string];
icon?: string;
verification_level?: number; verification_level?: number;
default_message_notifications?: number; default_message_notifications?: number;
system_channel_flags?: number; system_channel_flags?: number;
system_channel_id?: bigint;
explicit_content_filter?: number; explicit_content_filter?: number;
public_updates_channel_id?: bigint; public_updates_channel_id?: bigint;
afk_timeout?: number; afk_timeout?: number;