✨ Schema
This commit is contained in:
@@ -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;
|
||||
}[];
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user