Skip to content

Commit

Permalink
Fix check behaviour in the help command (serenity-rs#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgao authored Jul 5, 2020
1 parent 6b1021f commit e000833
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/framework/standard/help_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,17 @@ fn check_command_behaviour(
let b = check_common_behaviour(&ctx, msg, &options, owners, help_options);

if b == HelpBehaviour::Nothing {
for check in options.checks {
if !check.check_in_help {
break;
}
if !options.owner_privilege || !owners.contains(&msg.author.id) {
for check in options.checks {
if !check.check_in_help {
continue;
}

let mut args = Args::new("", &[]);
let mut args = Args::new("", &[]);

if let CheckResult::Failure(_) = (check.function)(ctx, msg, &mut args, options) {
return help_options.lacking_conditions;
if let CheckResult::Failure(_) = (check.function)(ctx, msg, &mut args, options) {
return help_options.lacking_conditions;
}
}
}
}
Expand Down Expand Up @@ -897,9 +899,9 @@ pub fn create_customised_help_data<'a>(
}

let strikethrough_command_tip = if msg.is_private() {
&help_options.strikethrough_commands_tip_in_guild
} else {
&help_options.strikethrough_commands_tip_in_dm
} else {
&help_options.strikethrough_commands_tip_in_guild
};

let description = if let Some(ref strikethrough_command_text) = strikethrough_command_tip {
Expand Down

0 comments on commit e000833

Please sign in to comment.