private string ExtractCommandKey(CommandParsingContext context, string command) { var prefixes = context.GetPrefixes(); var separators = context.GetSeparators(); // Trim off any prefix characters from the start of the command and split on the first occurrence of any separator characters string commandKey = command.TrimStart(prefixes); int splitIndex = commandKey.IndexOfAny(separators); if (splitIndex > -1 && splitIndex < commandKey.Length) { commandKey = commandKey.Substring(0, splitIndex); } return(commandKey); }
private string ExtractCommandKey(CommandParsingContext context, string command) { var prefixes = context.GetPrefixes(); var separators = context.GetSeparators(); // Trim off any prefix characters from the start of the command and split on the first occurrence of any separator characters string commandKey = command.TrimStart(prefixes); int splitIndex = commandKey.IndexOfAny(separators); if (splitIndex > -1 && splitIndex < commandKey.Length) { commandKey = commandKey.Substring(0, splitIndex); } return commandKey; }
private bool IsCommand(CommandParsingContext context, string argument) { var prefixes = context.GetPrefixes(); return(argument.StartsWithAny(prefixes)); }
private bool IsCommand(CommandParsingContext context, string argument) { var prefixes = context.GetPrefixes(); return argument.StartsWithAny(prefixes); }