aboutsummaryrefslogtreecommitdiff
path: root/lib/models/channel
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2019-02-04 13:59:23 -0700
committerAdelyn Breelove <[email protected]>2019-02-04 13:59:23 -0700
commit23cc7c6ea03ac6ad92c8da3101eb878daeb3bc2e (patch)
tree42441f45c99e8bfaeabf4cd2083d4e375c41d92e /lib/models/channel
parentUpdate yojson to 1.6.0 (diff)
downloaddisml-23cc7c6ea03ac6ad92c8da3101eb878daeb3bc2e.tar.xz
disml-23cc7c6ea03ac6ad92c8da3101eb878daeb3bc2e.zip
Update to latest master on ppx_deriving_yojson
Diffstat (limited to 'lib/models/channel')
-rw-r--r--lib/models/channel/channel_t.ml14
-rw-r--r--lib/models/channel/channel_t.mli14
-rw-r--r--lib/models/channel/message/attachment.ml2
-rw-r--r--lib/models/channel/message/attachment.mli2
-rw-r--r--lib/models/channel/message/embed.ml14
-rw-r--r--lib/models/channel/message/embed.mli14
-rw-r--r--lib/models/channel/message/message_t.ml2
-rw-r--r--lib/models/channel/message/message_t.mli2
-rw-r--r--lib/models/channel/message/reaction_t.ml4
-rw-r--r--lib/models/channel/message/reaction_t.mli4
10 files changed, 36 insertions, 36 deletions
diff --git a/lib/models/channel/channel_t.ml b/lib/models/channel/channel_t.ml
index 1705bdf..8611d9c 100644
--- a/lib/models/channel/channel_t.ml
+++ b/lib/models/channel/channel_t.ml
@@ -10,13 +10,13 @@ type group = {
name: string option [@default None];
owner_id: User_id_t.t;
recipients: User_t.t list [@default []];
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type dm = {
id: Channel_id_t.t;
last_message_id: Message_id.t option [@default None];
last_pin_timestamp: string option [@default None];
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type guild_text = {
id: Channel_id_t.t;
@@ -29,7 +29,7 @@ type guild_text = {
topic: string option [@default None];
nsfw: bool;
slow_mode_timeout: int option [@default None];
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type guild_voice = {
id: Channel_id_t.t;
@@ -39,14 +39,14 @@ type guild_voice = {
position: int;
user_limit: int [@default -1];
bitrate: int option [@default None];
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type category = {
id: Channel_id_t.t;
guild_id: Guild_id_t.t option [@default None];
position: int;
name: string;
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
type t =
| Group of group
@@ -54,7 +54,7 @@ type t =
| GuildText of guild_text
| GuildVoice of guild_voice
| Category of category
-[@@deriving sexp, yojson { strict = false}]
+[@@deriving sexp, yojson { strict = false; exn = true }]
type channel_wrapper = {
id: Channel_id_t.t;
@@ -74,7 +74,7 @@ type channel_wrapper = {
application_id: Snowflake.t option [@default None];
category_id: Channel_id_t.t option [@default None][@key "parent_id"];
last_pin_timestamp: string option [@default None];
-} [@@deriving sexp, yojson { strict = false}]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
let unwrap_as_guild_text {id;guild_id;position;name;topic;nsfw;last_message_id;slow_mode_timeout;category_id;last_pin_timestamp;_} =
let position = Option.value_exn position in
diff --git a/lib/models/channel/channel_t.mli b/lib/models/channel/channel_t.mli
index 30c90a5..313939f 100644
--- a/lib/models/channel/channel_t.mli
+++ b/lib/models/channel/channel_t.mli
@@ -9,14 +9,14 @@ type group = {
name: string option;
owner_id: User_id_t.t;
recipients: User_t.t list;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** 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]
+} [@@deriving sexp, yojson { exn = true }]
(** Represents a text channel in a guild. *)
type guild_text = {
@@ -30,7 +30,7 @@ type guild_text = {
topic: string option;
nsfw: bool;
slow_mode_timeout: int option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** Represents a voice channel in a guild. *)
type guild_voice = {
@@ -41,7 +41,7 @@ type guild_voice = {
position: int;
user_limit: int;
bitrate: int option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** Represents a guild category. *)
type category = {
@@ -49,7 +49,7 @@ type category = {
guild_id: Guild_id_t.t option;
position: int;
name: string;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** Wrapper variant for all channel types. *)
type t =
@@ -58,7 +58,7 @@ type t =
| GuildText of guild_text
| GuildVoice of guild_voice
| Category of category
-[@@deriving sexp, yojson]
+[@@deriving sexp, yojson { exn = true }]
(** Intermediate used internally. *)
type channel_wrapper = {
@@ -79,7 +79,7 @@ type channel_wrapper = {
application_id: Snowflake.t option;
category_id: Channel_id_t.t option;
last_pin_timestamp: string option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
val unwrap_as_guild_text : channel_wrapper -> guild_text
diff --git a/lib/models/channel/message/attachment.ml b/lib/models/channel/message/attachment.ml
index c56b389..d720a81 100644
--- a/lib/models/channel/message/attachment.ml
+++ b/lib/models/channel/message/attachment.ml
@@ -8,4 +8,4 @@ type t = {
proxy_url: string;
height: int [@default -1];
width: int [@default -1];
-} [@@deriving sexp, yojson { strict = false}] \ No newline at end of file
+} [@@deriving sexp, yojson { strict = false; exn = true }] \ No newline at end of file
diff --git a/lib/models/channel/message/attachment.mli b/lib/models/channel/message/attachment.mli
index f935471..56006dc 100644
--- a/lib/models/channel/message/attachment.mli
+++ b/lib/models/channel/message/attachment.mli
@@ -6,4 +6,4 @@ type t = {
proxy_url: string;
height: int;
width: int;
-} [@@deriving sexp, yojson] \ No newline at end of file
+} [@@deriving sexp, yojson { exn = true }] \ No newline at end of file
diff --git a/lib/models/channel/message/embed.ml b/lib/models/channel/message/embed.ml
index 584d3c7..f66aa3f 100644
--- a/lib/models/channel/message/embed.ml
+++ b/lib/models/channel/message/embed.ml
@@ -4,38 +4,38 @@ type footer = {
text: string;
icon_url: string option [@default None];
proxy_icon_url: string option [@default None];
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type image = {
url: string option [@default None];
proxy_url: string option [@default None];
height: int option [@default None];
width: int option [@default None];
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type video = {
url: string option [@default None];
height: int option [@default None];
width: int option [@default None];
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type provider = {
name: string option [@default None];
url: string option [@default None];
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type author = {
name: string option [@default None];
url: string option [@default None];
icon_url: string option [@default None];
proxy_icon_url: string option [@default None];
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type field = {
name: string;
value: string;
inline: bool [@default false];
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type t = {
title: string option [@default None];
@@ -51,7 +51,7 @@ type t = {
provider: provider option [@default None];
author: author option [@default None];
fields: field list [@default []];
-} [@@deriving sexp, yojson { strict = false }]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
let default = {
title = None;
diff --git a/lib/models/channel/message/embed.mli b/lib/models/channel/message/embed.mli
index d30d015..fb86c94 100644
--- a/lib/models/channel/message/embed.mli
+++ b/lib/models/channel/message/embed.mli
@@ -3,7 +3,7 @@ type footer = {
text: string;
icon_url: string option;
proxy_icon_url: string option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** An image object belonging to an embed. *)
type image = {
@@ -11,20 +11,20 @@ type image = {
proxy_url: string option;
height: int option;
width: int option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** A video object belonging to an embed. *)
type video = {
url: string option;
height: int option;
width: int option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** A provider object belonging to an embed. *)
type provider = {
name: string option;
url: string option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** An author object belonging to an embed. *)
type author = {
@@ -32,14 +32,14 @@ type author = {
url: string option;
icon_url: string option;
proxy_icon_url: string option;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** A field object belonging to an embed. *)
type field = {
name: string;
value: string;
inline: bool;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** An embed object. See this {{:https://leovoel.github.io/embed-visualizer/}embed visualiser} if you need help understanding each component. *)
type t = {
@@ -56,7 +56,7 @@ type t = {
provider: provider option;
author: author option;
fields: field list [@default []];
-} [@@deriving sexp, yojson { strict = false }]
+} [@@deriving sexp, yojson { strict = false; exn = true }]
(** An embed where all values are empty. *)
val default : t
diff --git a/lib/models/channel/message/message_t.ml b/lib/models/channel/message/message_t.ml
index 34ff64e..31fc88c 100644
--- a/lib/models/channel/message/message_t.ml
+++ b/lib/models/channel/message/message_t.ml
@@ -20,4 +20,4 @@ type t = {
pinned: bool;
webhook_id: Snowflake.t option [@default None];
kind: int [@key "type"];
-} [@@deriving sexp, yojson { strict = false}] \ No newline at end of file
+} [@@deriving sexp, yojson { strict = false; exn = true }] \ No newline at end of file
diff --git a/lib/models/channel/message/message_t.mli b/lib/models/channel/message/message_t.mli
index ba8c62a..907565c 100644
--- a/lib/models/channel/message/message_t.mli
+++ b/lib/models/channel/message/message_t.mli
@@ -19,4 +19,4 @@ type t = {
pinned: bool; (** Whether the message is pinned. *)
webhook_id: Snowflake.t option; (** The webhook ID, if the message was sent by a webhook. *)
kind: int; (** See {{:https://discordapp.com/developers/docs/resources/channel#message-object-message-types}the discord docs} for message type enumeration. *)
-} [@@deriving sexp, yojson] \ No newline at end of file
+} [@@deriving sexp, yojson { exn = true }] \ No newline at end of file
diff --git a/lib/models/channel/message/reaction_t.ml b/lib/models/channel/message/reaction_t.ml
index 7c78baf..e8ec5a0 100644
--- a/lib/models/channel/message/reaction_t.ml
+++ b/lib/models/channel/message/reaction_t.ml
@@ -6,9 +6,9 @@ type reaction_event = {
message_id: Message_id.t;
guild_id: Guild_id_t.t option [@default None];
emoji: Emoji.partial_emoji;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
type t = {
count: int;
emoji: Emoji.t;
-} [@@deriving sexp, yojson { strict = false}] \ No newline at end of file
+} [@@deriving sexp, yojson { strict = false; exn = true }] \ No newline at end of file
diff --git a/lib/models/channel/message/reaction_t.mli b/lib/models/channel/message/reaction_t.mli
index ace8f55..f9b2a98 100644
--- a/lib/models/channel/message/reaction_t.mli
+++ b/lib/models/channel/message/reaction_t.mli
@@ -5,10 +5,10 @@ type reaction_event = {
message_id: Message_id.t;
guild_id: Guild_id_t.t option;
emoji: Emoji.partial_emoji;
-} [@@deriving sexp, yojson]
+} [@@deriving sexp, yojson { exn = true }]
(** Represents a number of emojis used as a reaction on a message. *)
type t = {
count: int;
emoji: Emoji.t;
-} [@@deriving sexp, yojson] \ No newline at end of file
+} [@@deriving sexp, yojson { exn = true }] \ No newline at end of file