Add SimpleChatFilter AddOn.

This commit is contained in:
Casper V. Kristensen 2021-05-26 22:29:57 +02:00
parent 8e23db5fe0
commit c6784ed3d6
Signed by: caspervk
GPG key ID: 289CA03790535054
3 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,2 @@
# SimpleChatFilter
World of Warcraft Classic AddOn to filter annoying spam from the general chat channels.

View 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")

View 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