aboutsummaryrefslogtreecommitdiff
path: root/bin/bot.ml
blob: 7d7f714d6a6ad58c5868642e9c128fd0b7ca8772 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
open Async
open Core

module Client = Disml.Client.Make(struct
    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)

let _ =
    Scheduler.go_main ~main ()