aboutsummaryrefslogtreecommitdiff
path: root/lib/models/id/channel_id.ml
diff options
context:
space:
mode:
authorMatias Goldfeld <[email protected]>2021-01-27 17:15:05 -0500
committerMatias Goldfeld <[email protected]>2021-01-27 17:15:05 -0500
commit8fc7e259c365c6a84b216b7548b87bc2a96d6868 (patch)
tree5ea4f7d6ff82727d62b01fb2d234a4f8ab66aa2b /lib/models/id/channel_id.ml
parentFixed sending file attachments by adding multiform support (diff)
downloaddisml-8fc7e259c365c6a84b216b7548b87bc2a96d6868.tar.xz
disml-8fc7e259c365c6a84b216b7548b87bc2a96d6868.zip
Added message_reference functionality
Diffstat (limited to 'lib/models/id/channel_id.ml')
-rw-r--r--lib/models/id/channel_id.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/models/id/channel_id.ml b/lib/models/id/channel_id.ml
index 1aa3fbb..1ea7a46 100644
--- a/lib/models/id/channel_id.ml
+++ b/lib/models/id/channel_id.ml
@@ -4,7 +4,7 @@ include Channel_id_t
exception Invalid_message
exception No_message_found
-let send_message ?embed ?content ?files ?(tts=false) ch =
+let send_message ?embed ?content ?files ?(tts=false) ?reply ch =
let embed = match embed with
| Some e -> Embed.to_yojson e
| None -> `Null in
@@ -14,10 +14,14 @@ let send_message ?embed ?content ?files ?(tts=false) ch =
let () = match embed, content with
| `Null, `Null -> raise Invalid_message
| _ -> () in
+ let message_reference = match reply with
+ | Some m -> `Assoc [("message_id", Message_id.to_yojson m)]
+ | None -> `Null in
Http.create_message ?files (get_id ch) (`Assoc [
("embed", embed);
("content", content);
("tts", `Bool tts);
+ ("message_reference", message_reference);
])
let say content ch =