* Add ability to support different types of quotation marks * Added normal quotation mark to list of aliases, removed single quote mark * clean up leftover changes from testing * change quotation mark parsing to use a map of matching pairs * remove commented out code * Fix conventions of the command parser utility functions * change storage type of alias dictionary to be IReadOnlyDictionary * revert type of CommandServiceConfig QuotationMarkAliasMap to Dictionary * minor formatting changes to CommandParser * remove unnecessary whitespace * Move aliases outside of CommandInfo class * copy IReadOnlyDictionary to ImmutableDictionary * minor syntax changes in CommandServiceConfig * add newline before namespace for consistency * newline formatting tweak * simplification of GetMatch method for CommandParser * add more quote unicode punctuation pairs * add check for null value when building ImmutableDictionary * Move default alias map into a separate source file * Ensure that the collection passed into command service is not null
30 lines
1.3 KiB
C#
30 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Discord.Commands
|
|
{
|
|
public class CommandServiceConfig
|
|
{
|
|
/// <summary> Gets or sets the default RunMode commands should have, if one is not specified on the Command attribute or builder. </summary>
|
|
public RunMode DefaultRunMode { get; set; } = RunMode.Sync;
|
|
|
|
public char SeparatorChar { get; set; } = ' ';
|
|
|
|
/// <summary> Determines whether commands should be case-sensitive. </summary>
|
|
public bool CaseSensitiveCommands { get; set; } = false;
|
|
|
|
/// <summary> Gets or sets the minimum log level severity that will be sent to the Log event. </summary>
|
|
public LogSeverity LogLevel { get; set; } = LogSeverity.Info;
|
|
|
|
/// <summary> Determines whether RunMode.Sync commands should push exceptions up to the caller. </summary>
|
|
public bool ThrowOnError { get; set; } = true;
|
|
|
|
/// <summary> Collection of aliases that can wrap strings for command parsing.
|
|
/// represents the opening quotation mark and the value is the corresponding closing mark.</summary>
|
|
public Dictionary<char, char> QuotationMarkAliasMap { get; set; } = QuotationAliasUtils.GetDefaultAliasMap;
|
|
|
|
/// <summary> Determines whether extra parameters should be ignored. </summary>
|
|
public bool IgnoreExtraArgs { get; set; } = false;
|
|
}
|
|
}
|