View Single Post
12-06-23, 07:26 AM   #24
Sormon
A Kobold Labourer
Join Date: Dec 2023
Posts: 1
Originally Posted by Kkthnx View Post
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?
  Reply With Quote