예제 #1
0
        public static string Censor(this string s, WordGuardControl control)
        {
            if (control == WordGuardControl.Inactive)
            {
                return(s);
            }

            if (control == WordGuardControl.Careful)
            {
                return(s.MarkdownSpoiler());
            }

            if (control == WordGuardControl.Controlled)
            {
                return(s[0] + s.Censor().Substring(1));
            }

            return(s.Censor());
        }
예제 #2
0
 public void SetWordGuard(WordGuardControl ctrl)
 => WordGuardHandling = ctrl;