diff options
| author | acdenisSK <[email protected]> | 2017-07-10 22:36:19 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-07-10 22:36:19 +0200 |
| commit | 29ee627207e0c2a0d3f5310ac00d90b232d910c0 (patch) | |
| tree | 7acb29be8be47e5df509126d79083710e575b54c /src | |
| parent | Return an error if the reason the user provided exceeded the limit (diff) | |
| download | serenity-29ee627207e0c2a0d3f5310ac00d90b232d910c0.tar.xz serenity-29ee627207e0c2a0d3f5310ac00d90b232d910c0.zip | |
Rename `online_members` to `members_with_status` and compare the status provided to the function instead
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/guild/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index bc736d5..97eb3a4 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -668,14 +668,14 @@ impl Guild { self.id.members(limit, after) } - /// Gets a list of all the online members in this guild. - pub fn online_members(&self) -> Vec<&Member> { + /// Gets a list of all the members (satisfying the status provided to the function) in this guild. + pub fn members_with_status(&self, status: OnlineStatus) -> Vec<&Member> { let mut members = vec![]; for (&id, member) in &self.members { match self.presences.get(&id) { Some(presence) => { - if OnlineStatus::Online == presence.status { + if status == presence.status { members.push(member); } }, |