🐛 fix GuildUpdate Schema

This commit is contained in:
Flam3rboy 2021-08-07 19:30:40 +02:00
parent 31df0bfe7b
commit 45e97e894c

View File

@ -8,6 +8,7 @@ export const GuildCreateSchema = {
$channels: [Object], $channels: [Object],
$guild_template_code: String, $guild_template_code: String,
$system_channel_id: String, $system_channel_id: String,
$rules_channel_id: String
}; };
export interface GuildCreateSchema { export interface GuildCreateSchema {
@ -17,10 +18,13 @@ export interface GuildCreateSchema {
channels?: GuildChannel[]; channels?: GuildChannel[];
guild_template_code?: string; guild_template_code?: string;
system_channel_id?: string; system_channel_id?: string;
rules_channel_id?: string;
} }
export const GuildUpdateSchema = { export const GuildUpdateSchema = {
...GuildCreateSchema, ...GuildCreateSchema,
name: undefined,
$name: new Length(String, 2, 100),
$banner: String, $banner: String,
$splash: String, $splash: String,
$description: String, $description: String,
@ -34,6 +38,7 @@ export const GuildUpdateSchema = {
$public_updates_channel_id: String, $public_updates_channel_id: String,
$afk_timeout: Number, $afk_timeout: Number,
$afk_channel_id: String, $afk_channel_id: String,
$preferred_locale: String
}; };
// @ts-ignore // @ts-ignore
delete GuildUpdateSchema.$channels; delete GuildUpdateSchema.$channels;
@ -50,6 +55,7 @@ export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels"> {
public_updates_channel_id?: string; public_updates_channel_id?: string;
afk_timeout?: number; afk_timeout?: number;
afk_channel_id?: string; afk_channel_id?: string;
preferred_locale?: string;
} }
export const GuildGetSchema = { export const GuildGetSchema = {
@ -96,31 +102,30 @@ export const GuildGetSchema = {
public_updates_channel_id: true, public_updates_channel_id: true,
max_video_channel_users: true, max_video_channel_users: true,
approximate_member_count: true, approximate_member_count: true,
approximate_presence_count: true, approximate_presence_count: true
// welcome_screen: true, // welcome_screen: true,
}; };
export const GuildTemplateCreateSchema = { export const GuildTemplateCreateSchema = {
name: String, name: String,
$avatar: String, $avatar: String
}; };
export interface GuildTemplateCreateSchema { export interface GuildTemplateCreateSchema {
name: string, name: string;
avatar?: string, avatar?: string;
} }
export const GuildAddChannelToWelcomeScreenSchema = { export const GuildAddChannelToWelcomeScreenSchema = {
channel_id: String, channel_id: String,
description: String, description: String,
$emoji_id: String, $emoji_id: String,
emoji_name: String, emoji_name: String
} };
export interface GuildAddChannelToWelcomeScreenSchema { export interface GuildAddChannelToWelcomeScreenSchema {
channel_id: string; channel_id: string;
description: string; description: string;
emoji_id?: string; emoji_id?: string;
emoji_name: string; emoji_name: string;
} }