From 110b97513fbd26695674190ab217800490e27185 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Sat, 26 May 2018 23:15:01 -0700 Subject: [PATCH 1/3] Add more XML comments to quotation mark alias map stuff, including an example --- .../CommandServiceConfig.cs | 22 +++++++++++++++++-- .../Utilities/QuotationAliasUtils.cs | 6 ++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/Discord.Net.Commands/CommandServiceConfig.cs b/src/Discord.Net.Commands/CommandServiceConfig.cs index 00091634d..474dc783d 100644 --- a/src/Discord.Net.Commands/CommandServiceConfig.cs +++ b/src/Discord.Net.Commands/CommandServiceConfig.cs @@ -8,6 +8,9 @@ namespace Discord.Commands /// Gets or sets the default RunMode commands should have, if one is not specified on the Command attribute or builder. public RunMode DefaultRunMode { get; set; } = RunMode.Sync; + /// + /// The delimiter which separates command parameters. + /// public char SeparatorChar { get; set; } = ' '; /// Determines whether commands should be case-sensitive. @@ -19,8 +22,23 @@ namespace Discord.Commands /// Determines whether RunMode.Sync commands should push exceptions up to the caller. public bool ThrowOnError { get; set; } = true; - /// Collection of aliases that can wrap strings for command parsing. - /// represents the opening quotation mark and the value is the corresponding closing mark. + /// + /// Collection of aliases for matching pairs of string delimiters. + /// The dictionary stores the opening delimiter as a key, and the matching closing delimiter as the value. + /// If no value is supplied will be used, which contains + /// many regional equivalents. + /// If this map is set to null or empty, the default delimiter of " will be used. + /// + /// + /// + /// QuotationMarkAliasMap = new Dictionary<char, char%gt;() + /// { + /// {'\"', '\"' }, + /// {'“', '”' }, + /// {'「', '」' }, + /// } + /// + /// public Dictionary QuotationMarkAliasMap { get; set; } = QuotationAliasUtils.GetDefaultAliasMap; /// Determines whether extra parameters should be ignored. diff --git a/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs b/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs index 15a08b9b3..2970735a9 100644 --- a/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs +++ b/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs @@ -6,13 +6,13 @@ using System.Globalization; namespace Discord.Commands { /// - /// Utility methods for generating matching pairs of unicode quotation marks for CommandServiceConfig + /// Utility class which contains the default matching pairs of quotation marks for CommandServiceConfig /// internal static class QuotationAliasUtils { /// - /// Generates an IEnumerable of characters representing open-close pairs of - /// quotation punctuation. + /// A default map of open-close pairs of quotation marks. + /// Contains many regional and Unicode equivalents. /// internal static Dictionary GetDefaultAliasMap { From cb7c6d35464bd2d8aa0d5cc0dd20c8a6fa11bb4f Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Sat, 26 May 2018 23:29:32 -0700 Subject: [PATCH 2/3] Add reference to CommandServiceConfig from the util docs' --- src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs b/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs index 2970735a9..dc2328c1c 100644 --- a/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs +++ b/src/Discord.Net.Commands/Utilities/QuotationAliasUtils.cs @@ -13,7 +13,9 @@ namespace Discord.Commands /// /// A default map of open-close pairs of quotation marks. /// Contains many regional and Unicode equivalents. + /// Used in the . /// + /// internal static Dictionary GetDefaultAliasMap { get From a8d3031b2d73bbe813e83bb439345975d1003b55 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Sat, 26 May 2018 23:32:40 -0700 Subject: [PATCH 3/3] Add explanation that if " is removed then it wont work --- src/Discord.Net.Commands/CommandServiceConfig.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Discord.Net.Commands/CommandServiceConfig.cs b/src/Discord.Net.Commands/CommandServiceConfig.cs index 474dc783d..a6dd9e33c 100644 --- a/src/Discord.Net.Commands/CommandServiceConfig.cs +++ b/src/Discord.Net.Commands/CommandServiceConfig.cs @@ -27,6 +27,8 @@ namespace Discord.Commands /// The dictionary stores the opening delimiter as a key, and the matching closing delimiter as the value. /// If no value is supplied will be used, which contains /// many regional equivalents. + /// Only values that are specified in this map will be used as string delimiters, so if " is removed then + /// it won't be used. /// If this map is set to null or empty, the default delimiter of " will be used. /// ///