aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-10 22:36:19 +0200
committeracdenisSK <[email protected]>2017-07-10 22:36:19 +0200
commit29ee627207e0c2a0d3f5310ac00d90b232d910c0 (patch)
tree7acb29be8be47e5df509126d79083710e575b54c /src
parentReturn an error if the reason the user provided exceeded the limit (diff)
downloadserenity-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.rs6
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);
}
},