aboutsummaryrefslogtreecommitdiff
path: root/lib/dispatch.mli
diff options
context:
space:
mode:
authorAdelyn Breedlove <[email protected]>2019-01-19 15:58:31 -0700
committerAdelyn Breedlove <[email protected]>2019-01-19 15:58:31 -0700
commitb678d7312518bb0ff74d7db364bcbbcded5c1609 (patch)
tree39094fc179c33fc67269ffc3fea218384c558cfe /lib/dispatch.mli
parentupdate docs export (diff)
downloaddisml-b678d7312518bb0ff74d7db364bcbbcded5c1609.tar.xz
disml-b678d7312518bb0ff74d7db364bcbbcded5c1609.zip
more updates
Diffstat (limited to 'lib/dispatch.mli')
-rw-r--r--lib/dispatch.mli19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/dispatch.mli b/lib/dispatch.mli
index 51d94b4..0442c19 100644
--- a/lib/dispatch.mli
+++ b/lib/dispatch.mli
@@ -1,3 +1,22 @@
+(** Used to store dispatch callbacks. Each event can only have one callback registered at a time.
+ These should be accessed through their re-export in {!Client}.
+ {3 Examples}
+ [Client.ready := (fun _ -> print_endline "Shard is Ready!")]
+
+ [Client.guild_create := (fun guild -> print_endline guild.name)]
+
+ {[
+ open Core
+ open Disml
+
+ let check_command (msg : Message.t) =
+ if String.is_prefix ~prefix:"!ping" msg.content then
+ Message.reply msg "Pong!" >>> ignore
+
+ Client.message_create := check_command
+ ]}
+*)
+
(** Dispatched when connecting to the gateway, most users will have no use for this. *)
val hello : (Yojson.Safe.json -> unit) ref