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

let main sharder =
    Lwt_engine.on_timer 60.0 true begin
        fun _ev -> Sharder.set_status_with sharder @@ begin
        fun shard ->
            `String ("Current seq: " ^ string_of_int shard.seq)
        end
        >|= (fun _ -> print_endline "Status set!")
        |> ignore;
    end

let _ =
    Sharder.start @@ Sys.getenv "DISCORD_TOKEN"
    >>= (fun sharder ->
    main sharder
    |> ignore;
    sharder.promise)
    |> Lwt_main.run