aboutsummaryrefslogtreecommitdiff
path: root/src/framework/standard/help_commands.rs
diff options
context:
space:
mode:
authorLakelezz <[email protected]>2018-05-25 19:58:04 +0200
committerAlex M. M <[email protected]>2018-05-25 19:58:04 +0200
commit89a18aa919d8c08cf9fba9a98ebe32c9fd59d5d4 (patch)
tree95104f88f6745c28d5470453136687ca88fd68d0 /src/framework/standard/help_commands.rs
parentAdd an option for a bot to work only in certain channels (#318) (diff)
downloadserenity-89a18aa919d8c08cf9fba9a98ebe32c9fd59d5d4.tar.xz
serenity-89a18aa919d8c08cf9fba9a98ebe32c9fd59d5d4.zip
help: differentiate whether a command is unavailable in dms or guilds (#319)
Diffstat (limited to 'src/framework/standard/help_commands.rs')
-rw-r--r--src/framework/standard/help_commands.rs27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/framework/standard/help_commands.rs b/src/framework/standard/help_commands.rs
index 3acc37b..28adb9f 100644
--- a/src/framework/standard/help_commands.rs
+++ b/src/framework/standard/help_commands.rs
@@ -38,12 +38,12 @@ use std::{
};
use super::command::InternalCommand;
use super::{
- Args,
- CommandGroup,
- CommandOrAlias,
- HelpOptions,
- CommandOptions,
- CommandError,
+ Args,
+ CommandGroup,
+ CommandOrAlias,
+ HelpOptions,
+ CommandOptions,
+ CommandError,
HelpBehaviour
};
use utils::Colour;
@@ -222,8 +222,13 @@ pub fn with_embeds<H: BuildHasher>(
let _ = msg.channel_id.send_message(|m| {
m.embed(|mut e| {
+ let striked_command_tip = if msg.is_private() {
+ &help_options.striked_commands_tip_in_guild
+ } else {
+ &help_options.striked_commands_tip_in_dm
+ };
- if let Some(ref striked_command_text) = help_options.striked_commands_tip {
+ if let Some(ref striked_command_text) = striked_command_tip {
e = e.colour(help_options.embed_success_colour).description(
format!("{}\n{}", &help_options.individual_command_tip, striked_command_text),
);
@@ -461,7 +466,13 @@ pub fn plain<H: BuildHasher>(
let mut result = "**Commands**\n".to_string();
- if let Some(ref striked_command_text) = help_options.striked_commands_tip {
+ let striked_command_tip = if msg.is_private() {
+ &help_options.striked_commands_tip_in_guild
+ } else {
+ &help_options.striked_commands_tip_in_dm
+ };
+
+ if let Some(ref striked_command_text) = striked_command_tip {
let _ = write!(result, "{}\n{}\n\n", &help_options.individual_command_tip, striked_command_text);
} else {
let _ = write!(result, "{}\n\n", &help_options.individual_command_tip);