Add SimpleChatFilter AddOn.
This commit is contained in:
parent
8e23db5fe0
commit
c6784ed3d6
2
SimpleChatFilter/README.md
Normal file
2
SimpleChatFilter/README.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
# SimpleChatFilter
|
||||
World of Warcraft Classic AddOn to filter annoying spam from the general chat channels.
|
20
SimpleChatFilter/SimpleChatFilter.lua
Normal file
20
SimpleChatFilter/SimpleChatFilter.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
local discardedPatterns = {
|
||||
"wts.*boost",
|
||||
"wtb.*boost",
|
||||
"selling.*boost",
|
||||
"wtb.*dmt",
|
||||
}
|
||||
|
||||
|
||||
local function simpleChatFilter(chatFrame, event, text, playerName, _, channelName, _, specialFlags, zoneChannelID, channelIndex, channelBaseName, _, lineID, guid)
|
||||
local textLower = text:lower()
|
||||
for _, pattern in pairs(discardedPatterns) do
|
||||
if textLower:find(pattern) then
|
||||
return true -- discard message
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", simpleChatFilter)
|
||||
print("[|cFFFF7777SimpleChatFilter|r] Discarding|cFFCCCCCC", table.concat(discardedPatterns, " |cFFFF7777|||cFFCCCCCC "), "|r")
|
10
SimpleChatFilter/SimpleChatFilter.toc
Normal file
10
SimpleChatFilter/SimpleChatFilter.toc
Normal file
|
@ -0,0 +1,10 @@
|
|||
## Interface: 11305
|
||||
|
||||
## Title: SimpleChatFilter
|
||||
## Notes: Simple chat filter.
|
||||
## Author: Caspervk
|
||||
## Version: 0.0.1
|
||||
|
||||
## X-License: GNU General Public License v3 or later (GPLv3+)
|
||||
|
||||
SimpleChatFilter.lua
|
Loading…
Reference in a new issue