View Single Post
03/29/21, 01:33 PM   #1
AuthenticGlitch
Join Date: Mar 2021
Posts: 2
Intercept Chat Messages

I know addons like pChat can filter out spam messages in zone chat and I'm curious how to go about doing this for my own addon. From my research I know I can add a function to the EVENT_CHAT_MESSAGE_CHANNEL but I would assume this does not actually intercept the message it just lets you see what the message is and do something with the information provided, or am I wrong?

For example, would the following code prevent whispers from appearing if I'm in a group instance? This is not exactly what I want to do, its just an example so I can understand things better.
Code:
OnChatMessage(eventCode, channelType, senderAcc, message, isCustomerSevice, senderName)
	if channelType == CHAT_CATEGORY_WHISPER_INCOMING then
		if IsInGroupInstance() then return end
	end
end
Now, if I'm correct and this does not intercept the message how would I go about ensuring specific message from this event does not make it through to the chat window?

Thanks for any help you can provide.
  Reply With Quote