aboutsummaryrefslogtreecommitdiff
path: root/lib/message.ml
diff options
context:
space:
mode:
authorMishio595 <[email protected]>2018-11-24 09:51:03 -0700
committerMishio595 <[email protected]>2018-11-24 09:51:03 -0700
commitd342c4cf9fe907d2107cd815f9988f8ad147218b (patch)
treefebb926d6f3e1956346db2d3ee952391b193deb9 /lib/message.ml
parentAdd opam build file (diff)
downloaddisml-d342c4cf9fe907d2107cd815f9988f8ad147218b.tar.xz
disml-d342c4cf9fe907d2107cd815f9988f8ad147218b.zip
Major structural changes
Diffstat (limited to 'lib/message.ml')
-rw-r--r--lib/message.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/message.ml b/lib/message.ml
new file mode 100644
index 0000000..5b632d7
--- /dev/null
+++ b/lib/message.ml
@@ -0,0 +1,12 @@
+type t = {
+ id: string;
+ content: string;
+ channel: string;
+}
+
+let from_json term =
+ let module J = Yojson.Basic.Util in
+ let id = J.(member "id" term |> to_string) in
+ let content = J.(member "content" term |> to_string) in
+ let channel = J.(member "channel_id" term |> to_string) in
+ { id; content; channel; }