Originally Posted by Kkthnx
Here you go
Code:
SLASH_CLEARCHAT1 = "/clear"
SLASH_CLEARCHAT2 = "/clearchat"
SlashCmdList.CLEARCHAT = function(cmd)
cmd = cmd and strtrim(strlower(cmd))
for i = 1, NUM_CHAT_WINDOWS do
local f = _G["ChatFrame"..i]
if f:IsVisible() or cmd == "all" then
f:Clear()
end
end
end
I tested this window by window and this is what you are looking for 100%
Credits to Phanx / PhanxChat
https://github.com/Phanx/PhanxChat/b.../Core.lua#L273
|
How do you actually implement and use this in the game?