diff options
| author | Adelyn Breelove <[email protected]> | 2019-01-21 09:08:47 -0700 |
|---|---|---|
| committer | Adelyn Breelove <[email protected]> | 2019-01-21 09:08:47 -0700 |
| commit | b6ad18b9795428c39292c15c712c7ce0ec0986c6 (patch) | |
| tree | 5113f4bb480815ee316e847cca954060afc419af /lib/models/channel | |
| parent | folder restructure (diff) | |
| download | disml-b6ad18b9795428c39292c15c712c7ce0ec0986c6.tar.xz disml-b6ad18b9795428c39292c15c712c7ce0ec0986c6.zip | |
finish making model signatures
Diffstat (limited to 'lib/models/channel')
| -rw-r--r-- | lib/models/channel/channel_t.mli | 89 | ||||
| -rw-r--r-- | lib/models/channel/message/message_t.mli | 43 | ||||
| -rw-r--r-- | lib/models/channel/message/reaction_t.mli | 12 |
3 files changed, 144 insertions, 0 deletions
diff --git a/lib/models/channel/channel_t.mli b/lib/models/channel/channel_t.mli new file mode 100644 index 0000000..2ac66fb --- /dev/null +++ b/lib/models/channel/channel_t.mli @@ -0,0 +1,89 @@ +exception Invalid_channel of Yojson.Safe.json + +type group = { + id: Snowflake.t; + last_message_id: Snowflake.t option; + last_pin_timestamp: string option; + icon: string option; + name: string option; + owner_id: Snowflake.t; + recipients: User_t.t list; +} [@@deriving sexp, yojson] + +type dm = { + id: Snowflake.t; + last_message_id: Snowflake.t option; + last_pin_timestamp: string option; +} [@@deriving sexp, yojson] + +type guild_text = { + id: Snowflake.t; + last_message_id: Snowflake.t option; + last_pin_timestamp: string option; + category_id: Snowflake.t option; + guild_id: Snowflake.t option; + name: string; + position: int; + topic: string option; + nsfw: bool; + slow_mode_timeout: int option; +} [@@deriving sexp, yojson] + +type guild_voice = { + id: Snowflake.t; + category_id: Snowflake.t option; + guild_id: Snowflake.t option; + name: string; + position: int; + user_limit: int; + bitrate: int option; +} [@@deriving sexp, yojson] + +type category = { + id: Snowflake.t; + guild_id: Snowflake.t option; + position: int; + name: string; +} [@@deriving sexp, yojson] + +type t = +| Group of group +| Private of dm +| GuildText of guild_text +| GuildVoice of guild_voice +| Category of category +[@@deriving sexp, yojson] + +type channel_wrapper = { + id: Snowflake.t; + kind: int; + guild_id: Snowflake.t option; + position: int option; + name: string option; + topic: string option; + nsfw: bool option; + last_message_id: Snowflake.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: Snowflake.t option; + application_id: Snowflake.t option; + category_id: Snowflake.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 diff --git a/lib/models/channel/message/message_t.mli b/lib/models/channel/message/message_t.mli new file mode 100644 index 0000000..20360e8 --- /dev/null +++ b/lib/models/channel/message/message_t.mli @@ -0,0 +1,43 @@ +type message_update = { + id: Snowflake.t; + author: User_t.t option; + channel_id: Snowflake.t; + member: Member_t.partial_member option; + guild_id: Snowflake.t option; + content: string option; + timestamp: string option; + editedimestamp: string option; + tts: bool option; + mention_everyone: bool option; + mentions: Snowflake.t list; + role_mentions: Snowflake.t list; + attachments: Attachment.t list; + embeds: Embed.t list; + reactions: Snowflake.t list; + nonce: Snowflake.t option; + pinned: bool option; + webhook_id: Snowflake.t option; + kind: int option; +} [@@deriving sexp, yojson] + +type t = { + id: Snowflake.t; + author: User_t.t; + channel_id: Snowflake.t; + member: Member_t.partial_member option; + guild_id: Snowflake.t option; + content: string; + timestamp: string; + editedimestamp: string option; + tts: bool; + mention_everyone: bool; + (* mentions: Snowflake.t list; *) + (* role_mentions: Snowflake.t list; *) + attachments: Attachment.t list; + embeds: Embed.t list; + reactions: Snowflake.t list; + nonce: Snowflake.t option; + pinned: bool; + webhook_id: Snowflake.t option; + kind: int; +} [@@deriving sexp, yojson]
\ No newline at end of file diff --git a/lib/models/channel/message/reaction_t.mli b/lib/models/channel/message/reaction_t.mli new file mode 100644 index 0000000..5bdd275 --- /dev/null +++ b/lib/models/channel/message/reaction_t.mli @@ -0,0 +1,12 @@ +type reaction_event = { + user_id: Snowflake.t; + channel_id: Snowflake.t; + message_id: Snowflake.t; + guild_id: Snowflake.t option; + emoji: Emoji.partial_emoji; +} [@@deriving sexp, yojson] + +type t = { + count: int; + emoji: Emoji.t; +} [@@deriving sexp, yojson]
\ No newline at end of file |