aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorLake Lezz <[email protected]>2018-11-16 02:27:06 +0100
committeracdenisSK <[email protected]>2018-11-16 20:57:13 +0100
commit653e596527020954738104558a8596ae0c378279 (patch)
treedaedfe7ec9e41f98772b8ea5d8c9d5a4ae77c86a /src/model
parentMerge branch 'current' into v0.6.x (diff)
downloadserenity-653e596527020954738104558a8596ae0c378279.tar.xz
serenity-653e596527020954738104558a8596ae0c378279.zip
Add Slow Mode Rate (#439)
Fixes #402
Diffstat (limited to 'src/model')
-rw-r--r--src/model/channel/guild_channel.rs3
-rw-r--r--src/model/channel/mod.rs1
-rw-r--r--src/model/misc.rs1
3 files changed, 5 insertions, 0 deletions
diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs
index 02d1c1f..046ca7c 100644
--- a/src/model/channel/guild_channel.rs
+++ b/src/model/channel/guild_channel.rs
@@ -87,6 +87,9 @@ pub struct GuildChannel {
// default to `false`.
#[serde(default)]
pub nsfw: bool,
+ /// A rate limit that applies per user and excludes bots.
+ #[serde(default, rename = "rate_limit_per_user")]
+ pub slow_mode_rate: u64,
}
#[cfg(feature = "model")]
diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs
index bc4ea75..5b2b16e 100644
--- a/src/model/channel/mod.rs
+++ b/src/model/channel/mod.rs
@@ -743,6 +743,7 @@ mod test {
topic: None,
user_limit: None,
nsfw: false,
+ slow_mode_rate: 0,
}
}
diff --git a/src/model/misc.rs b/src/model/misc.rs
index 9c09a9b..87c3c44 100644
--- a/src/model/misc.rs
+++ b/src/model/misc.rs
@@ -330,6 +330,7 @@ mod test {
topic: None,
user_limit: None,
nsfw: false,
+ slow_mode_rate: 0,
})));
let emoji = Emoji {
animated: false,