✨ Schema

This commit is contained in:
Flam3rboy
2021-03-04 22:01:45 +01:00
parent 1f1743c927
commit 56c9e43777
7 changed files with 109 additions and 29 deletions
+51
View File
@@ -0,0 +1,51 @@
import { Length } from "../util/instanceOf";
export const ChannelModifySchema = {
name: new Length(String, 2, 100),
type: Number,
$topic: new Length(String, 0, 1024),
$bitrate: Number,
$user_limit: Number,
$rate_limit_per_user: new Length(Number, 0, 21600),
$position: Number,
$permission_overwrites: [
{
id: BigInt,
type: new Length(Number, 0, 1), // either 0 (role) or 1 (member)
allow: BigInt,
deny: BigInt,
},
],
$parent_id: BigInt,
$nsfw: Boolean,
};
export interface ChannelModifySchema {
name: string;
type: number;
topic?: string;
bitrate?: number;
user_limit?: number;
rate_limit_per_user?: Number;
position?: number;
permission_overwrites?: {
id: bigint;
type: number;
allow: bigint;
deny: bigint;
}[];
parent_id?: bigint;
nsfw?: boolean;
}
export const ChannelGuildPositionUpdateSchema = [
{
id: BigInt,
$position: Number,
},
];
export type ChannelGuildPositionUpdateSchema = {
id: bigint;
position?: number;
}[];
+27
View File
@@ -0,0 +1,27 @@
export const MessageCreateSchema = {
content: String,
nonce: Number,
tts: Boolean,
embed: {},
allowed_mentions: [],
message_reference: {
message_id: BigInt,
channel_id: BigInt,
guild_id: BigInt,
fail_if_not_exists: Boolean,
},
};
export interface MessageCreateSchema {
content: string;
nonce: number;
tts: boolean;
embed: {};
allowed_mentions: [];
message_reference: {
message_id: bigint;
channel_id: bigint;
guild_id: bigint;
fail_if_not_exists: boolean;
};
}