diff options
| author | Ken Swenson <[email protected]> | 2018-12-19 13:27:10 -0500 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2018-12-19 19:29:08 +0100 |
| commit | 109da2bc341f45ba740c81f21b072cf4cfc11dcf (patch) | |
| tree | baf9639ae6077c0b53c71f00a6cbda3fba25c8c3 /src/model | |
| parent | Remove global Cache (#448) (diff) | |
| download | serenity-109da2bc341f45ba740c81f21b072cf4cfc11dcf.tar.xz serenity-109da2bc341f45ba740c81f21b072cf4cfc11dcf.zip | |
Limit users requested from reaction to 100 (#451)
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel/reaction.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs index 6c5bdeb..30d8186 100644 --- a/src/model/channel/reaction.rs +++ b/src/model/channel/reaction.rs @@ -168,11 +168,16 @@ impl Reaction { limit: Option<u8>, after: Option<UserId>, ) -> Result<Vec<User>> { + let mut limit = limit.unwrap_or(50); + if limit > 100 { + limit = 100; + warn!("Rection users limit clamped to 100! (API Restriction)"); + } http::get_reaction_users( self.channel_id.0, self.message_id.0, reaction_type, - limit.unwrap_or(50), + limit, after.map(|u| u.0), ) } |