aboutsummaryrefslogtreecommitdiff
path: root/bin/bot.ml
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bot.ml')
-rw-r--r--bin/bot.ml18
1 files changed, 6 insertions, 12 deletions
diff --git a/bin/bot.ml b/bin/bot.ml
index 7d7f714..3608f85 100644
--- a/bin/bot.ml
+++ b/bin/bot.ml
@@ -1,21 +1,15 @@
open Async
open Core
+open Disml
-module Client = Disml.Client.Make(struct
+let main () =
let token = match Sys.getenv "DISCORD_TOKEN" with
| Some t -> t
| None -> failwith "No token in env"
-end)(Handler)
-
-let main () =
- Client.start ()
- >>> fun client ->
- Clock.every
- (Time.Span.create ~sec:60 ())
- (fun () ->
- print_endline "Setting status";
- Client.set_status ~status:(`String "Hello!") client
- >>> ignore)
+ in
+ Client.start token
+ >>> ignore
let _ =
+ Client.message_create := (fun msg -> print_endline msg.content);
Scheduler.go_main ~main ()