aboutsummaryrefslogtreecommitdiff
path: root/bin/bot.ml
blob: d1a7ca3d95e09508028f7b61fce35cf288e0e30d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 () =
    let client = Client.init () in
    Client.start client
    >>> 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 ()