aboutsummaryrefslogtreecommitdiff
path: root/src/framework/help_commands.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-27 08:10:41 +0200
committeracdenisSK <[email protected]>2017-07-27 08:10:41 +0200
commit70b5097aaac85f970c32ceb988dbb5f5d575ee0f (patch)
treed2f391d3b552cfae58b74748a2a2aa5ae80c7986 /src/framework/help_commands.rs
parentrustfmt (diff)
downloadserenity-70b5097aaac85f970c32ceb988dbb5f5d575ee0f.tar.xz
serenity-70b5097aaac85f970c32ceb988dbb5f5d575ee0f.zip
Change the config a bit, and a few nitpicks
Diffstat (limited to 'src/framework/help_commands.rs')
-rw-r--r--src/framework/help_commands.rs28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/framework/help_commands.rs b/src/framework/help_commands.rs
index 7f863b4..6db3561 100644
--- a/src/framework/help_commands.rs
+++ b/src/framework/help_commands.rs
@@ -33,8 +33,9 @@ use model::{ChannelId, Message};
use utils::Colour;
fn error_embed(channel_id: &ChannelId, input: &str) {
- let _ =
- channel_id.send_message(|m| m.embed(|e| e.colour(Colour::dark_red()).description(input)));
+ let _ = channel_id.send_message(|m| {
+ m.embed(|e| e.colour(Colour::dark_red()).description(input))
+ });
}
fn remove_aliases(cmds: &HashMap<String, CommandOrAlias>) -> HashMap<&String, &InternalCommand> {
@@ -158,9 +159,10 @@ pub fn with_embeds(_: &mut Context,
let _ = msg.channel_id.send_message(|m| {
m.embed(|mut e| {
- e = e.colour(Colour::rosewater())
- .description("To get help with an individual command, pass its \
- name as an argument to this command.");
+ e = e.colour(Colour::rosewater()).description(
+ "To get help with an individual command, pass its \
+ name as an argument to this command.",
+ );
let mut group_names = groups.keys().collect::<Vec<_>>();
group_names.sort();
@@ -275,14 +277,16 @@ pub fn plain(_: &mut Context,
let _ = write!(result, "**Group:** {}\n", group_name);
}
+ let only = if command.dm_only {
+ "Only in DM"
+ } else if command.guild_only {
+ "Only in guilds"
+ } else {
+ "In DM and guilds"
+ };
+
result.push_str("**Available:** ");
- result.push_str(if command.dm_only {
- "Only in DM"
- } else if command.guild_only {
- "Only in guilds"
- } else {
- "In DM and guilds"
- });
+ result.push_str(only);
result.push_str("\n");
let _ = msg.channel_id.say(&result);