diff options
| author | Adelyn Breedlove <[email protected]> | 2019-01-28 10:31:51 -0700 |
|---|---|---|
| committer | Adelyn Breedlove <[email protected]> | 2019-01-28 10:31:51 -0700 |
| commit | 8662e92987c437f59d09896a247ec2b5d82c4528 (patch) | |
| tree | f004cc14598351d4ad6b19d8e993d2f629c5e738 /lib/models/channel/channel_t.mli | |
| parent | Add more docs (diff) | |
| download | disml-8662e92987c437f59d09896a247ec2b5d82c4528.tar.xz disml-8662e92987c437f59d09896a247ec2b5d82c4528.zip | |
Publish docs updates
Diffstat (limited to 'lib/models/channel/channel_t.mli')
| -rw-r--r-- | lib/models/channel/channel_t.mli | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/lib/models/channel/channel_t.mli b/lib/models/channel/channel_t.mli index 9deea82..711b319 100644 --- a/lib/models/channel/channel_t.mli +++ b/lib/models/channel/channel_t.mli @@ -1,96 +1,96 @@ -exception Invalid_channel of Yojson.Safe.json - -(** Represents a Group channel object. *) -type group = { - id: Channel_id_t.t; - last_message_id: Message_id.t option; - last_pin_timestamp: string option; - icon: string option; - name: string option; - owner_id: User_id_t.t; - recipients: User_t.t list; -} [@@deriving sexp, yojson] - -(** Represents a private channel with a single user. *) -type dm = { - id: Channel_id_t.t; - last_message_id: Message_id.t option; - last_pin_timestamp: string option; -} [@@deriving sexp, yojson] - -(** Represents a text channel in a guild. *) -type guild_text = { - id: Channel_id_t.t; - last_message_id: Message_id.t option; - last_pin_timestamp: string option; - category_id: Channel_id_t.t option; - guild_id: Guild_id_t.t option; - name: string; - position: int; - topic: string option; - nsfw: bool; - slow_mode_timeout: int option; -} [@@deriving sexp, yojson] - -(** Represents a voice channel in a guild. *) -type guild_voice = { - id: Channel_id_t.t; - category_id: Channel_id_t.t option; - guild_id: Guild_id_t.t option; - name: string; - position: int; - user_limit: int; - bitrate: int option; -} [@@deriving sexp, yojson] - -(** Represents a guild category. *) -type category = { - id: Channel_id_t.t; - guild_id: Guild_id_t.t option; - position: int; - name: string; -} [@@deriving sexp, yojson] - -(** Wrapper variant for all channel types. *) -type t = -| Group of group -| Private of dm -| GuildText of guild_text -| GuildVoice of guild_voice -| Category of category -[@@deriving sexp, yojson] - -(** Intermediate used internally. *) -type channel_wrapper = { - id: Channel_id_t.t; - kind: int; - guild_id: Guild_id_t.t option; - position: int option; - name: string option; - topic: string option; - nsfw: bool option; - last_message_id: Message_id.t option; - bitrate: int option; - user_limit: int option; - slow_mode_timeout: int option; - recipients: User_t.t list option; - icon: string option; - owner_id: User_id_t.t option; - application_id: Snowflake.t option; - category_id: Channel_id_t.t option; - last_pin_timestamp: string option; -} [@@deriving sexp, yojson] - -val unwrap_as_guild_text : channel_wrapper -> guild_text - -val unwrap_as_guild_voice : channel_wrapper -> guild_voice - -val unwrap_as_dm : channel_wrapper -> dm - -val unwrap_as_group : channel_wrapper -> group - -val unwrap_as_category : channel_wrapper -> category - -val wrap : channel_wrapper -> t - +exception Invalid_channel of Yojson.Safe.json
+
+(** Represents a Group channel object. *)
+type group = {
+ id: Channel_id_t.t;
+ last_message_id: Message_id.t option;
+ last_pin_timestamp: string option;
+ icon: string option;
+ name: string option;
+ owner_id: User_id_t.t;
+ recipients: User_t.t list;
+} [@@deriving sexp, yojson]
+
+(** Represents a private channel with a single user. *)
+type dm = {
+ id: Channel_id_t.t;
+ last_message_id: Message_id.t option;
+ last_pin_timestamp: string option;
+} [@@deriving sexp, yojson]
+
+(** Represents a text channel in a guild. *)
+type guild_text = {
+ id: Channel_id_t.t;
+ last_message_id: Message_id.t option;
+ last_pin_timestamp: string option;
+ category_id: Channel_id_t.t option;
+ guild_id: Guild_id_t.t option;
+ name: string;
+ position: int;
+ topic: string option;
+ nsfw: bool;
+ slow_mode_timeout: int option;
+} [@@deriving sexp, yojson]
+
+(** Represents a voice channel in a guild. *)
+type guild_voice = {
+ id: Channel_id_t.t;
+ category_id: Channel_id_t.t option;
+ guild_id: Guild_id_t.t option;
+ name: string;
+ position: int;
+ user_limit: int;
+ bitrate: int option;
+} [@@deriving sexp, yojson]
+
+(** Represents a guild category. *)
+type category = {
+ id: Channel_id_t.t;
+ guild_id: Guild_id_t.t option;
+ position: int;
+ name: string;
+} [@@deriving sexp, yojson]
+
+(** Wrapper variant for all channel types. *)
+type t =
+| Group of group
+| Private of dm
+| GuildText of guild_text
+| GuildVoice of guild_voice
+| Category of category
+[@@deriving sexp, yojson]
+
+(** Intermediate used internally. *)
+type channel_wrapper = {
+ id: Channel_id_t.t;
+ kind: int;
+ guild_id: Guild_id_t.t option;
+ position: int option;
+ name: string option;
+ topic: string option;
+ nsfw: bool option;
+ last_message_id: Message_id.t option;
+ bitrate: int option;
+ user_limit: int option;
+ slow_mode_timeout: int option;
+ recipients: User_t.t list option;
+ icon: string option;
+ owner_id: User_id_t.t option;
+ application_id: Snowflake.t option;
+ category_id: Channel_id_t.t option;
+ last_pin_timestamp: string option;
+} [@@deriving sexp, yojson]
+
+val unwrap_as_guild_text : channel_wrapper -> guild_text
+
+val unwrap_as_guild_voice : channel_wrapper -> guild_voice
+
+val unwrap_as_dm : channel_wrapper -> dm
+
+val unwrap_as_group : channel_wrapper -> group
+
+val unwrap_as_category : channel_wrapper -> category
+
+val wrap : channel_wrapper -> t
+
val get_id : t -> Snowflake.t
\ No newline at end of file |