Originally Posted by Ayantir
You can't read chat buffer, you need to catch them when messages comes.
|
Lua Code:
--Put this somewhere above and outside the player activated event callback function
local function myChatMessageChannelCallbackFunction(eventCode, messageType, fromName, text)
if messageType = CHAT_CHANNEL_GUILD1 then
d("Guild channel 1 message received from " .. fromName .. ": " .. text)
end
--return false = run the other event callback functions for the same event
--return true = don#t run the other event callback functions for this event as you tell them by "true": Everything was done already in this function here
--The same applies to ZoPreHook() and ZoPreHookHandler() functions
return false
end
--Put this into player activated event callback function
--Register the event for new text messages to check incoming texts at all the chat channels
EVENT_MANAGER:RegisterForEvent("MyAddonName_ChatMessageChannel", EVENT_CHAT_MESSAGE_CHANNEL, myChatMessageChannelCallbackFunction)