aboutsummaryrefslogtreecommitdiff
path: root/bin
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 /bin
parentCorrect reaction deserialize (diff)
downloaddisml-982d860120d71f454d3f1da9e562eadc9d3d95fc.tar.xz
disml-982d860120d71f454d3f1da9e562eadc9d3d95fc.zip
Minor updates
Diffstat (limited to 'bin')
-rw-r--r--bin/bot.ml6
1 files changed, 3 insertions, 3 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 _ =