diff options
| author | Lakelezz <[email protected]> | 2018-09-09 13:12:38 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-09-09 13:12:38 +0200 |
| commit | ce79f0183d9fc457ce0fc10fa94e3a1350f33f66 (patch) | |
| tree | 71581b64458327fa533aba59d07569a459833d67 /src/framework/standard/create_help_command.rs | |
| parent | Add Member::user_id (diff) | |
| download | serenity-ce79f0183d9fc457ce0fc10fa94e3a1350f33f66.tar.xz serenity-ce79f0183d9fc457ce0fc10fa94e3a1350f33f66.zip | |
Suggest similar commands when using help (#377)
Diffstat (limited to 'src/framework/standard/create_help_command.rs')
| -rw-r--r-- | src/framework/standard/create_help_command.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/framework/standard/create_help_command.rs b/src/framework/standard/create_help_command.rs index b1fd8ec..b8eb57a 100644 --- a/src/framework/standard/create_help_command.rs +++ b/src/framework/standard/create_help_command.rs @@ -218,6 +218,13 @@ impl CreateHelpCommand { self } + /// Sets the maximum Levenshtein-distance to find similar commands. + pub fn max_levenshtein_distance(mut self, distance: usize) -> Self { + self.0.max_levenshtein_distance = distance; + + self + } + fn produce_strike_text(&self, dm_or_guild: &str) -> Option<String> { let mut strike_text = String::from("~~`Strikethrough commands`~~ are unavailable because they"); let mut is_any_option_strike = false; |