Beispiel #1
0
        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)));
            }
        }