diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index 9420476d5..c52fca261 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -20,6 +20,7 @@ namespace Discord.Commands private readonly CommandMap _map; internal readonly RunMode _defaultRunMode; + internal readonly string _nodeSeparator; public IEnumerable Modules => _moduleDefs.Select(x => x); public IEnumerable Commands => _moduleDefs.SelectMany(x => x.Commands); @@ -68,6 +69,7 @@ namespace Discord.Commands [typeof(IGuildUser)] = new UserTypeReader(), }; _defaultRunMode = config.DefaultRunMode; + _nodeSeparator = config.NodeSeparator; } //Modules diff --git a/src/Discord.Net.Commands/CommandServiceConfig.cs b/src/Discord.Net.Commands/CommandServiceConfig.cs index 97c98a54c..66ddade10 100644 --- a/src/Discord.Net.Commands/CommandServiceConfig.cs +++ b/src/Discord.Net.Commands/CommandServiceConfig.cs @@ -4,5 +4,7 @@ { /// The default RunMode commands should have, if one is not specified on the Command attribute or builder. public RunMode DefaultRunMode { get; set; } = RunMode.Mixed; + /// What character should be used between command nodes + public string NodeSeparator { get; set; } = " "; } } diff --git a/src/Discord.Net.Commands/Info/CommandInfo.cs b/src/Discord.Net.Commands/Info/CommandInfo.cs index 2ca8b1651..4d862da0c 100644 --- a/src/Discord.Net.Commands/Info/CommandInfo.cs +++ b/src/Discord.Net.Commands/Info/CommandInfo.cs @@ -42,7 +42,6 @@ namespace Discord.Commands // both command and module provide aliases if (module.Aliases.Count > 0 && builder.Aliases.Count > 0) - Aliases = module.Aliases.Permutate(builder.Aliases, (first, second) => second != null ? first + " " + second : first).ToImmutableArray(); // only module provides aliases else if (module.Aliases.Count > 0) Aliases = module.Aliases.ToImmutableArray(); @@ -50,6 +49,7 @@ namespace Discord.Commands else if (builder.Aliases.Count > 0) Aliases = builder.Aliases.ToImmutableArray(); // neither provide aliases + Aliases = module.Aliases.Permutate(builder.Aliases, (first, second) => second != null ? first + " " + second : first).ToImmutableArray(); else throw new InvalidOperationException("Cannot build a command without any aliases");