diff --git a/api/src/schema/Guild.ts b/api/src/schema/Guild.ts
index e5971baf..3e98fe76 100644
--- a/api/src/schema/Guild.ts
+++ b/api/src/schema/Guild.ts
@@ -1,4 +1,4 @@
-import { ChannelSchema, GuildChannel } from "@fosscord/util";
+import { Channel } from "@fosscord/util";
import { Length } from "../util/instanceOf";
import { ChannelModifySchema } from "./Channel";
@@ -33,7 +33,7 @@ export const GuildUpdateSchema = {
$icon: String,
$verification_level: Number,
$default_message_notifications: Number,
- $system_channel_flags: Number,
+ $system_channel_flags: String,
$system_channel_id: String,
$explicit_content_filter: Number,
$public_updates_channel_id: String,
@@ -59,54 +59,6 @@ export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels"> {
preferred_locale?: string;
}
-export const GuildGetSchema = {
- id: true,
- name: true,
- icon: true,
- splash: true,
- discovery_splash: true,
- owner: true,
- owner_id: true,
- permissions: true,
- region: true,
- afk_channel_id: true,
- afk_timeout: true,
- widget_enabled: true,
- widget_channel_id: true,
- verification_level: true,
- default_message_notifications: true,
- explicit_content_filter: true,
- roles: true,
- emojis: true,
- features: true,
- mfa_level: true,
- application_id: true,
- system_channel_id: true,
- system_channel_flags: true,
- rules_channel_id: true,
- joined_at: true,
- // large: true,
- // unavailable: true,
- member_count: true,
- // voice_states: true,
- // members: true,
- // channels: true,
- // presences: true,
- max_presences: true,
- max_members: true,
- vanity_url_code: true,
- description: true,
- banner: true,
- premium_tier: true,
- premium_subscription_count: true,
- preferred_locale: true,
- public_updates_channel_id: true,
- max_video_channel_users: true,
- approximate_member_count: true,
- approximate_presence_count: true
- // welcome_screen: true,
-};
-
export const GuildTemplateCreateSchema = {
name: String,
$avatar: String
@@ -117,16 +69,26 @@ export interface GuildTemplateCreateSchema {
avatar?: string;
}
-export const GuildAddChannelToWelcomeScreenSchema = {
- channel_id: String,
- description: String,
- $emoji_id: String,
- emoji_name: String
+export const GuildUpdateWelcomeScreenSchema = {
+ $welcome_channels: [
+ {
+ channel_id: String,
+ description: String,
+ $emoji_id: String,
+ emoji_name: String
+ }
+ ],
+ $enabled: Boolean,
+ $description: new Length(String, 0, 140)
};
-export interface GuildAddChannelToWelcomeScreenSchema {
- channel_id: string;
- description: string;
- emoji_id?: string;
- emoji_name: string;
+export interface GuildUpdateWelcomeScreenSchema {
+ welcome_channels?: {
+ channel_id: string;
+ description: string;
+ emoji_id?: string;
+ emoji_name: string;
+ }[];
+ enabled?: boolean;
+ description?: string;
}
diff --git a/api/src/schema/Message.ts b/api/src/schema/Message.ts
index 2dd54f0c..742542df 100644
--- a/api/src/schema/Message.ts
+++ b/api/src/schema/Message.ts
@@ -1,11 +1,17 @@
-import { Embed, EmbedImage } from "@fosscord/util";
+import { Embed } from "@fosscord/util";
import { Length } from "../util/instanceOf";
+export const EmbedImage = {
+ $url: String,
+ $width: Number,
+ $height: Number
+};
+
export const MessageCreateSchema = {
$content: new Length(String, 0, 2000),
$nonce: String,
$tts: Boolean,
- $flags: BigInt,
+ $flags: String,
$embed: {
$title: new Length(String, 0, 256), //title of embed
$type: String, // type of embed (always "rich" for webhook embeds)
@@ -63,7 +69,7 @@ export interface MessageCreateSchema {
content?: string;
nonce?: string;
tts?: boolean;
- flags?: bigint;
+ flags?: string;
embed?: Embed & { timestamp?: string };
allowed_mentions?: {
parse?: string[];
@@ -75,7 +81,7 @@ export interface MessageCreateSchema {
message_id: string;
channel_id: string;
guild_id?: string;
- fail_if_not_exists: boolean;
+ fail_if_not_exists?: boolean;
};
payload_json?: string;
file?: any;
diff --git a/api/src/schema/Roles.ts b/api/src/schema/Roles.ts
index f662e61b..1e5f560f 100644
--- a/api/src/schema/Roles.ts
+++ b/api/src/schema/Roles.ts
@@ -9,7 +9,7 @@ export const RoleModifySchema = {
export interface RoleModifySchema {
name?: string;
- permissions?: BigInt;
+ permissions?: bigint;
color?: number;
hoist?: boolean; // whether the role should be displayed separately in the sidebar
mentionable?: boolean; // whether the role should be mentionable
|