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

let main () =
    let token = match Sys.getenv "DISCORD_TOKEN" with
    | Some t -> t
    | None -> failwith "No token in env"
    in
    Client.start token
    >>> 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 ()