Exemple #1
0
        public static ReplacementWord TryExtractAddCommand(string chat)
        {
            string identifier = "!!add";

            // Split arguments with a space
            string[] commandArgs = chat.Split(null);

            if ((String.Compare(commandArgs[0], identifier) != 0) || (commandArgs.Length != 3))
            {
                return(null);
            }

            // Convert to Word object
            ReplacementWord word = new ReplacementWord(commandArgs[1], commandArgs[2]);

            return(word);
        }
Exemple #2
0
 public void Add(ReplacementWord word)
 {
     _words.Add(word.Pattern, word.Replace);
 }