OCaml bindings to Zulip API.
let _ =
let open Ozulip in
let conf = init "www.domain.com" "[email protected]" "key" in
let dest = Messages.stream_name "general" "welcom topic" in
Messages.send_message conf dest "New message from `ozulip`"
let _ =
let open Ozulip in
let conf = init "www.domain.com" "[email protected]" "key" in
let%lwt uri = Messages.upload_file conf "/path/to/your/file" in
let dest = Messages.stream_name "general" "welcom topic" in
let msg = Format.sprintf "Check out the [this file](%s)!" uri in
Messages.send_message conf dest msg
let _ =
let open Ozulip in
let conf = init "www.domain.com" "[email protected]" "key" in
let dest = Messages.stream_name "general" "welcom topic" in
let%lwt mess_id = Messages.send_message conf dest "New message from `ozulip`" in
Messages.edit_message ~content:"New content of my message" mess_id
let _ =
let open Ozulip in
let conf = init "www.domain.com" "[email protected]" "key" in
let dest = Messages.stream_name "general" "welcom topic" in
let%lwt mess_id = Messages.send_message conf dest "New message from `ozulip`" in
Messages.delete_message mess_id
let _ =
let open Ozulip in
let conf = init ~domain ~email ~key in
Events.interact ~trusted_emails:["[email protected]"] conf (fun msg ->
if String.lowercase_ascii msg = "ping"
then Lwt.return_some "pong"
else Lwt.return_none)