diff options
| -rw-r--r-- | lib/client.ml | 4 | ||||
| -rw-r--r-- | lib/client.mli | 1 | ||||
| -rw-r--r-- | lib/gateway/sharder.ml | 13 | ||||
| -rw-r--r-- | lib/gateway/sharder.mli | 2 |
4 files changed, 14 insertions, 6 deletions
diff --git a/lib/client.ml b/lib/client.ml index 9269807..cf7bd77 100644 --- a/lib/client.ml +++ b/lib/client.ml @@ -11,8 +11,8 @@ let start ?count ?compress ?(large=250) token = >>| fun sharder ->
{ sharder; }
-let set_status ?status ?kind ?name ?since client =
- Sharder.set_status ?status ?kind ?name ?since client.sharder
+let set_status ?status ?kind ?name ?since ?url client =
+ Sharder.set_status ?status ?kind ?name ?since ?url client.sharder
let request_guild_members ~guild ?query ?limit client =
let `Guild_id guild = guild in
diff --git a/lib/client.mli b/lib/client.mli index 8a0002b..4f9fdab 100644 --- a/lib/client.mli +++ b/lib/client.mli @@ -39,6 +39,7 @@ val set_status : ?kind:int ->
?name:string ->
?since:int ->
+ ?url:string ->
t ->
Sharder.Shard.shard list Deferred.t
diff --git a/lib/gateway/sharder.ml b/lib/gateway/sharder.ml index cd91e1a..71e900d 100644 --- a/lib/gateway/sharder.ml +++ b/lib/gateway/sharder.ml @@ -107,10 +107,15 @@ module Shard = struct ; session = session
}
- let set_status ?(status="online") ?(kind=0) ?name ?since shard =
+ let set_status ?(status="online") ?(kind=0) ?name ?since ?url shard =
let since = Option.(since >>| (fun v -> `Int v) |> value ~default:`Null) in
+ let url = Option.(url >>| (fun v -> `String v) |> value ~default:`Null) in
let game = match name with
- | Some name -> `Assoc [ "name", `String name; "type", `Int kind ]
+ | Some name -> `Assoc
+ [ "name", `String name
+ ; "type", `Int kind
+ ; "url", url
+ ]
| None -> `Null
in
let payload = `Assoc
@@ -361,9 +366,9 @@ let start ?count ?compress ?large_threshold () = >>| fun shards ->
{ shards }
-let set_status ?status ?kind ?name ?since sharder =
+let set_status ?status ?kind ?name ?since ?url sharder =
Deferred.all @@ List.map ~f:(fun t ->
- Shard.set_status ?status ?kind ?name ?since t.state
+ Shard.set_status ?status ?kind ?name ?since ?url t.state
) sharder.shards
let request_guild_members ?query ?limit ~guild sharder =
diff --git a/lib/gateway/sharder.mli b/lib/gateway/sharder.mli index 1851265..bbd8617 100644 --- a/lib/gateway/sharder.mli +++ b/lib/gateway/sharder.mli @@ -52,6 +52,7 @@ module Shard : sig ?kind:int ->
?name:string ->
?since:int ->
+ ?url:string ->
shard ->
shard Deferred.t
@@ -85,6 +86,7 @@ val set_status : ?kind:int ->
?name:string ->
?since:int ->
+ ?url:string ->
t ->
Shard.shard list Deferred.t
|