aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLakelezz <[email protected]>2017-10-10 23:21:57 +0200
committeralex <[email protected]>2017-10-10 23:21:57 +0200
commit08d390c19f187986fd2856fe5cbb9035a0877e0f (patch)
treed0c561d69384db17db582b5da9706bbab249b3a6 /src
parentAdd an iterator for `Args` (diff)
downloadserenity-08d390c19f187986fd2856fe5cbb9035a0877e0f.tar.xz
serenity-08d390c19f187986fd2856fe5cbb9035a0877e0f.zip
Make `has_correct_permissions`, `has_correct_roles` and `has_all_requirements` public. (#188)
Diffstat (limited to 'src')
-rw-r--r--src/framework/standard/help_commands.rs2
-rw-r--r--src/framework/standard/mod.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/framework/standard/help_commands.rs b/src/framework/standard/help_commands.rs
index 9bae941..91e173b 100644
--- a/src/framework/standard/help_commands.rs
+++ b/src/framework/standard/help_commands.rs
@@ -53,7 +53,7 @@ fn remove_aliases(cmds: &HashMap<String, CommandOrAlias>) -> HashMap<&String, &I
/// Checks whether a user is member of required roles
/// and given the required permissions.
-fn has_all_requirements(cmd: &Command, guild: &Guild, member: &Member, msg: &Message) -> bool {
+pub fn has_all_requirements(cmd: &Command, guild: &Guild, member: &Member, msg: &Message) -> bool {
if cmd.allowed_roles.is_empty() {
has_correct_permissions(cmd, msg)
} else {
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs
index 7156186..68bff80 100644
--- a/src/framework/standard/mod.rs
+++ b/src/framework/standard/mod.rs
@@ -942,7 +942,7 @@ impl Framework for StandardFramework {
}
#[cfg(feature = "cache")]
-pub(crate) fn has_correct_permissions(command: &Command, message: &Message) -> bool {
+pub fn has_correct_permissions(command: &Command, message: &Message) -> bool {
if !command.required_permissions.is_empty() {
if let Some(guild) = message.guild() {
let perms = guild
@@ -956,7 +956,7 @@ pub(crate) fn has_correct_permissions(command: &Command, message: &Message) -> b
}
#[cfg(feature = "cache")]
-pub(crate) fn has_correct_roles(cmd: &Command, guild: &Guild, member: &Member) -> bool {
+pub fn has_correct_roles(cmd: &Command, guild: &Guild, member: &Member) -> bool {
cmd.allowed_roles
.iter()
.flat_map(|r| guild.role_by_name(r))