summary refs log tree commit diff
path: root/src/models/Channel.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-11 20:44:12 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-11 20:44:12 +0100
commit1f7ebe256e00583bf0888d3f9e32ea1b8ef1b237 (patch)
tree5906b6dcc83593a8dae7d88e62fa62680c4dcda9 /src/models/Channel.ts
parent:sparkles: Event model (diff)
downloadserver-1f7ebe256e00583bf0888d3f9e32ea1b8ef1b237.tar.xz
:sparkles: updated other models
Diffstat (limited to 'src/models/Channel.ts')
-rw-r--r--src/models/Channel.ts51
1 files changed, 43 insertions, 8 deletions
diff --git a/src/models/Channel.ts b/src/models/Channel.ts

index 81fec185..068f6b67 100644 --- a/src/models/Channel.ts +++ b/src/models/Channel.ts
@@ -1,15 +1,27 @@ export interface Channel { id: bigint; - guild_id: bigint; - last_message_id: string; - last_pin_timestamp: string; + created_at: number; name: string; - nsfw: boolean; - parent_id: bigint; - position: number; - rate_limit_per_user: number; - topic: string | null; type: number; + read_state: ReadState[]; +} + +export interface ReadState { + last_message_id: bigint; + last_pin_timestamp: number; + mention_count: number; +} + +export interface TextBasedChannel { + messages: any[]; + last_message_id?: bigint; + last_pin_timestamp?: number; +} + +export interface GuildChannel extends Channel { + guild_id: bigint; + position: number; + parent_id?: bigint; permission_overwrites: { allow: bigint; deny: bigint; @@ -17,3 +29,26 @@ export interface Channel { type: number; }[]; } + +export interface VoiceChannel extends GuildChannel {} + +export interface TextChannel extends GuildChannel, TextBasedChannel { + nsfw: boolean; + rate_limit_per_user: number; + topic?: string; +} + +export interface DMChannel extends Channel, TextBasedChannel { + owner_id: bigint; + recipients: bigint[]; +} + +export enum ChannelType { + GUILD_TEXT = 0, // a text channel within a server + DM = 1, // a direct message between users + GUILD_VOICE = 2, // a voice channel within a server + GROUP_DM = 3, // a direct message between multiple users + GUILD_CATEGORY = 4, // an organizational category that contains up to 50 channels + GUILD_NEWS = 5, // a channel that users can follow and crosspost into their own server + GUILD_STORE = 6, // a channel in which game developers can sell their game on Discord +}