Exemplo n.º 1
0
        /// <summary>
        /// Mod command. Resets the blocked words set on a privileges group.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="core">The core.</param>
        public static void ResetBlockedWords(Command command, Core core = null)
        {
            if (Tools.IsNotModThenSendWarning(command))
            {
                return;
            }

            if (string.IsNullOrEmpty(command.Arguement))
            {
                Entites.Message.SendMessage(Message.Answer(command.Message,
                                                           "You must specify the privileges group which's blocked words shall be reseted."));
                return;
            }

            Entites.Privileges privileges = Privileges.GetPrivileges(command.Message.UserToChannel.Channel, command.Arguement);
            if (privileges == null)
            {
                Entites.Message.SendMessage(Message.Answer(command.Message,
                                                           $"No privileges group nammed {command.Arguement} was found."));
                return;
            }

            DAL.Privileges.LoadRules(privileges).Rules.BlockedWords = BlockedWord.GetDefaultBlockedWords();
            DAL.Rules.UpdateBlockedWords(privileges.Rules);
            Entites.Message.SendMessage(Message.Answer(command.Message, $"Blocked words of {command.Arguement} were successfully reinitialized."));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a rules object with a maximum amount of rules.
 /// </summary>
 /// <returns>The requested rules</returns>
 public static Entites.Rules GetNewUserRules()
 {
     Entites.Rules rules = new Entites.Rules(TimeSpan.FromSeconds(10), true, true, true, true, true)
     {
         BlockedWords = BlockedWord.GetDefaultBlockedWords()
     };
     return(rules);
 }