aboutsummaryrefslogtreecommitdiff
path: root/bin/bot.ml
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bot.ml')
-rw-r--r--bin/bot.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/bot.ml b/bin/bot.ml
index 329c22d..92825fc 100644
--- a/bin/bot.ml
+++ b/bin/bot.ml
@@ -1,6 +1,11 @@
open Async
open Core
-open Disml
+
+module Client = Disml.Client.Make(struct
+ let token = match Sys.getenv "DISCORD_TOKEN" with
+ | Some t -> t
+ | None -> failwith "No token in env"
+end)
(* let rec ev_loop read =
Pipe.read read >>= fun frame ->
@@ -38,12 +43,8 @@ open Disml
>>= fun _ -> ev_loop read *)
let main () =
- let token = match Sys.getenv "DISCORD_TOKEN" with
- | Some s -> s
- | None -> failwith "No token"
- in
let (_r,w) = Pipe.create () in
- let client = Client.create ~handler:w token in
+ let client = Client.init ~handler:w () in
(* ev_loop r >>> ignore; *)
Client.start client
>>> fun client ->