public ModeratedTypeEnum CheckStatus(ModerationEntityTypeEnum type, string entity) { if (_modMode[type] == ModerationTypeEnum.None) { return(ModeratedTypeEnum.None); } switch (type) { case ModerationEntityTypeEnum.Follower: return(ProcessFollower(entity)); case ModerationEntityTypeEnum.TwitterAccount: return(ProcessTwitterAccount(entity)); } throw new NotImplementedException($"Type {type} is not supported"); }
public static Regex Parse(ModerationEntityTypeEnum type, string data) { data = data.ToLowerInvariant().Trim(); if (type == ModerationEntityTypeEnum.Follower) { if (data.StartsWith("@")) { return(new Regex($@"^{data}$")); } if (data.StartsWith("*")) { data = data.Replace("*", "(.+)"); } return(new Regex($@"^@(.+)@{data}$")); } return(new Regex($@"^{data}$")); }
public ModerationTypeEnum GetModerationType(ModerationEntityTypeEnum type) { return(_modMode[type]); }