Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-14-23, 02:28 AM   #1
nancey
A Kobold Labourer
Join Date: Mar 2023
Posts: 1
Intercept outgoing chatmessages

Hi

Due to a 10 day ban I just got for saying "idiot" I've decided to create a simple addon to filter out the word "idiot".. yes I could just not say it, but solo shuffles.. man..


So far I've figured out (I think) that i want to intercept the event CHAT_MESSAGE_SAY
this is where google stops helping me, so any suggestions on how i either change the "msg" of the event or cancels the event and fires a new one with the edited text?

Code:
print("Outgoing Mature Language Filter Loaded")

local f=CreateFrame("Frame");-- Need a frame to capture events
f:RegisterEvent("CHAT_MSG_SAY");-- Register our event
f:SetScript("OnEvent",function(self,event,msg)-- OnEvent handler receives event triggers
	if event=="CHAT_MSG_SAY" and msg:match("idiot") then-- Someone sends "hello World" in /say
		
		-- somehow set msg to something else, prevent default event and fire new sendmessage

	end
end);
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Intercept outgoing chatmessages

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off