cfw is now insensitive to capitalization
This commit is contained in:
parent
ac8ade46a2
commit
96ce5e4b8f
@ -20,7 +20,7 @@ namespace NadekoBot.Commands {
|
|||||||
ServerPermissions serverPerms;
|
ServerPermissions serverPerms;
|
||||||
if (!IsChannelOrServerFiltering(args.Channel, out serverPerms)) return;
|
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))) {
|
if (serverPerms.Words.Any(w => wordsInMessage.Contains(w))) {
|
||||||
await args.Message.Delete();
|
await args.Message.Delete();
|
||||||
IncidentsHandler.Add(args.Server.Id, $"User [{args.User.Name}/{args.User.Id}] posted " +
|
IncidentsHandler.Add(args.Server.Id, $"User [{args.User.Name}/{args.User.Id}] posted " +
|
||||||
@ -71,7 +71,6 @@ namespace NadekoBot.Commands {
|
|||||||
PermissionsHandler.SetChannelWordPermission(curChannel, state);
|
PermissionsHandler.SetChannelWordPermission(curChannel, state);
|
||||||
}
|
}
|
||||||
await e.Channel.SendMessage($"Word filtering has been **{(state ? "enabled" : "disabled")}** for **ALL** channels.");
|
await e.Channel.SendMessage($"Word filtering has been **{(state ? "enabled" : "disabled")}** for **ALL** channels.");
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
await e.Channel.SendMessage($"💢 Error: {ex.Message}");
|
await e.Channel.SendMessage($"💢 Error: {ex.Message}");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user