From 1f7ebe256e00583bf0888d3f9e32ea1b8ef1b237 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 11 Feb 2021 20:44:12 +0100 Subject: :sparkles: updated other models --- src/models/Channel.ts | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'src/models/Channel.ts') 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 +} -- cgit 1.5.1