cfw is now insensitive to capitalization

This commit is contained in:
Master Kwoth 2016-03-22 21:58:15 +01:00
parent ac8ade46a2
commit 96ce5e4b8f

View File

@ -20,7 +20,7 @@ namespace NadekoBot.Commands {
ServerPermissions serverPerms;
if (!IsChannelOrServerFiltering(args.Channel, out serverPerms)) return;
var wordsInMessage = args.Message.RawText.Split(' ');
var wordsInMessage = args.Message.RawText.ToLowerInvariant().Split(' ');
if (serverPerms.Words.Any(w => wordsInMessage.Contains(w))) {
await args.Message.Delete();
IncidentsHandler.Add(args.Server.Id, $"User [{args.User.Name}/{args.User.Id}] posted " +
@ -71,7 +71,6 @@ namespace NadekoBot.Commands {
PermissionsHandler.SetChannelWordPermission(curChannel, state);
}
await e.Channel.SendMessage($"Word filtering has been **{(state ? "enabled" : "disabled")}** for **ALL** channels.");
} catch (Exception ex) {
await e.Channel.SendMessage($"💢 Error: {ex.Message}");
}