aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2019-01-31 15:11:11 -0700
committerAdelyn Breelove <[email protected]>2019-01-31 15:11:11 -0700
commit982d860120d71f454d3f1da9e562eadc9d3d95fc (patch)
tree69fb7d0a12c24a7c8ca8c2b60e6bb6b9da0f0810
parentCorrect reaction deserialize (diff)
downloaddisml-982d860120d71f454d3f1da9e562eadc9d3d95fc.tar.xz
disml-982d860120d71f454d3f1da9e562eadc9d3d95fc.zip
Minor updates
-rw-r--r--bin/bot.ml6
-rw-r--r--lib/client.ml1
-rw-r--r--lib/client.mli1
3 files changed, 3 insertions, 5 deletions
diff --git a/bin/bot.ml b/bin/bot.ml
index 1a682ee..693bc57 100644
--- a/bin/bot.ml
+++ b/bin/bot.ml
@@ -7,7 +7,7 @@ open Models
let client = Ivar.create ()
(* Define a function to handle message_create *)
-let check_command (Event.MessageCreate.{message}) =
+let check_command Event.MessageCreate.{message} =
(* Split content on space and return list head, list tail as tuple *)
let cmd, rest = match String.split ~on:' ' message.content with
| hd::tl -> hd, tl
@@ -106,6 +106,7 @@ let main () =
(* Set some event handlers *)
Client.message_create := check_command;
Client.ready := (fun _ -> Logs.info (fun m -> m "Ready!"));
+ Client.guild_create := (fun {guild} -> Logs.info (fun m -> m "Joined guild %s" guild.name));
(* Pull token from env var *)
let token = match Sys.getenv "DISCORD_TOKEN" with
| Some t -> t
@@ -113,9 +114,8 @@ let main () =
in
(* Start client with no special options *)
Client.start token
- >>> fun c ->
(* Fill that ivar once its done *)
- Ivar.fill client c
+ >>> Ivar.fill client
(* Lastly, we have to register this to the Async Scheduler for anything to work *)
let _ =
diff --git a/lib/client.ml b/lib/client.ml
index 8241046..a278d5a 100644
--- a/lib/client.ml
+++ b/lib/client.ml
@@ -1,5 +1,4 @@
open Async
-include Client_options
include Dispatch
type t = {
diff --git a/lib/client.mli b/lib/client.mli
index 346ce1a..0b855e8 100644
--- a/lib/client.mli
+++ b/lib/client.mli
@@ -1,6 +1,5 @@
open Async
-include module type of Client_options
include module type of Dispatch
(** Type of the Client, it isn't recommended to access the fields directly. *)