BadBoy is a spam blocking addon -- it only blocks gold selling ads, power leveling ads, and other actual spam like that. You probably want
BadBoy_CCleaner, which lets you input a list of words to block. However, it won't block system messages, as it's designed to block player messages in public channels.
For system messages, something like this will work:
Code:
local SystemBlacklist = {
"has come online",
"has joined the raid group",
"has defeated %S+ in a duel",
}
ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", function(_, _, message)
for i = 1, #SystemBlacklist do
if strmatch(message, SystemBlacklist[i]) then
return true
end
end
end)
If you can't use BadBoy_CCleaner for some reason (for example, if you need pattern/regex support) then you can do something similar for other message types:
Code:
local ChatBlacklist = {
"grats",
"ding",
"other bad words",
}
local ChatEvents = {
"CHAT_MSG_SAY",
"CHAT_MSG_YELL",
"CHAT_MSG_WHISPER",
"CHAT_MSG_CHANNEL",
"CHAT_MSG_GUILD",
"CHAT_MSG_PARTY",
"CHAT_MSG_RAID",
"CHAT_MSG_INSTANCE_CHAT",
}
local function ChatFilter(_, _, message)
for i = 1, #ChatBlacklist do
if strmatch(message, ChatBlacklist[i]) then
return true
end
end
end
for _, event in pairs(ChatEvents) do
ChatFrame_AddMessageEventFilter(event, ChatFilter)
end
Use
http://addon.ziuo.net/ to turn the above code snippets into addons.