| @@ -44,13 +44,13 @@ namespace Discord.Commands | |||||
| // both command and module provide aliases | // both command and module provide aliases | ||||
| if (module.Aliases.Count > 0 && builder.Aliases.Count > 0) | if (module.Aliases.Count > 0 && builder.Aliases.Count > 0) | ||||
| Aliases = module.Aliases.Permutate(builder.Aliases, (first, second) => second != null ? first + " " + second : first).ToImmutableArray(); | |||||
| Aliases = module.Aliases.Permutate(builder.Aliases, (first, second) => second != null ? first + " " + second : first).Select(x => service._caseSensitive ? x : x.ToLowerInvariant()).ToImmutableArray(); | |||||
| // only module provides aliases | // only module provides aliases | ||||
| else if (module.Aliases.Count > 0) | else if (module.Aliases.Count > 0) | ||||
| Aliases = module.Aliases.ToImmutableArray(); | |||||
| Aliases = module.Aliases.Select(x => service._caseSensitive ? x : x.ToLowerInvariant()).ToImmutableArray(); | |||||
| // only command provides aliases | // only command provides aliases | ||||
| else if (builder.Aliases.Count > 0) | else if (builder.Aliases.Count > 0) | ||||
| Aliases = builder.Aliases.ToImmutableArray(); | |||||
| Aliases = builder.Aliases.Select(x => service._caseSensitive ? x : x.ToLowerInvariant()).ToImmutableArray(); | |||||
| // neither provide aliases | // neither provide aliases | ||||
| else | else | ||||
| throw new InvalidOperationException("Cannot build a command without any aliases"); | throw new InvalidOperationException("Cannot build a command without any aliases"); | ||||