public async Task FilterExclude(CommandContext ctx, string word) { if (ctx.Member.GetRole().IsSeniorModOrHigher()) { await ctx.TriggerTypingAsync(); // Cancels: if (FilterSystem.IsWord(word)) { await ctx.Channel.SendMessageAsync( ChatObjects.GetErrMessage(@"Cannot add that word. It's a filter word...")); return; } if (Excludes.IsExcluded(word)) { await ctx.Channel.SendMessageAsync( ChatObjects.GetErrMessage(@"Cannot add that word. It's already excluded...")); return; } Excludes.AddWord(word); Excludes.Save(); await ctx.Channel.SendMessageAsync( ChatObjects.GetSuccessMessage( String.Format("I excluded the word {0}!", word))); } }
public async Task FilterInclude(CommandContext ctx, string word) { if (ctx.Member.GetRole().IsSeniorModOrHigher()) { await ctx.TriggerTypingAsync(); if (!Excludes.IsExcluded(word)) { await ctx.Channel.SendMessageAsync( ChatObjects.GetErrMessage(@"Cannot un-exclude that word. It's not already excluded...")); } else { Excludes.RemoveWord(word); Excludes.Save(); await ctx.Channel.SendMessageAsync( ChatObjects.GetSuccessMessage(@"I removed that word from exclusion!")); } } }