aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-08-24 07:52:01 -0700
committerZeyla Hellyer <[email protected]>2018-08-24 07:53:09 -0700
commit12bbc1ab79176d39c2528cae3c762404b0d5f8ab (patch)
tree7a1543a96c2f3c3b9c0efd36c2242039e6cb68d5 /src
parentFix a broken link in README (#373) (diff)
downloadserenity-12bbc1ab79176d39c2528cae3c762404b0d5f8ab.tar.xz
serenity-12bbc1ab79176d39c2528cae3c762404b0d5f8ab.zip
Add support for session start info in BotGateway
Add support for the new information describing the current session start ratelimits given in the GET /gateway/bot endpoint.
Diffstat (limited to 'src')
-rw-r--r--src/model/gateway.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/gateway.rs b/src/model/gateway.rs
index 28e3d68..ca9b92f 100644
--- a/src/model/gateway.rs
+++ b/src/model/gateway.rs
@@ -16,6 +16,9 @@ use super::prelude::*;
/// This is only applicable to bot users.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct BotGateway {
+ /// Information describing how many gateway sessions you can initiate within
+ /// a ratelimit period.
+ pub session_start_limit: SessionStartLimit,
/// The number of shards that is recommended to be used by the current bot
/// user.
pub shards: u64,
@@ -376,3 +379,16 @@ pub struct Ready {
#[serde(rename = "v")]
pub version: u64,
}
+
+/// Information describing how many gateway sessions you can initiate within a
+/// ratelimit period.
+#[derive(Clone, Debug, Deserialize, Serialize)]
+pub struct SessionStartLimit {
+ /// The number of sessions that you can still initiate within the current
+ /// ratelimit period.
+ pub remaining: u64,
+ /// The number of milliseconds until the ratelimit period resets.
+ pub reset_after: u64,
+ /// The total number of session starts within the ratelimit period allowed.
+ pub total: u64,
+} \ No newline at end of file