Lua Code:
Button:RegisterEvent("CHAT_MSG_GUILD")
Button:RegisterEvent("CHAT_MSG_OFFICER")
Button:RegisterEvent("CHAT_MSG_BATTLEGROUND")
Button:RegisterEvent("CHAT_MSG_BATTLEGROUND_LEADER")
Button:RegisterEvent("CHAT_MSG_PARTY")
Button:RegisterEvent("CHAT_MSG_RAID_LEADER")
Button:RegisterEvent("CHAT_MSG_RAID")
Button:RegisterEvent("CHAT_MSG_WHISPER")
Button:RegisterEvent("CHAT_MSG_BN_WHISPER")
Button:RegisterEvent("CHAT_MSG_CHANNEL")
Button:RegisterEvent("CHAT_MSG_SAY")
Button:SetScript("OnEvent", function(self, event, msg, sender, _, chanString, _, _, _, chanNumber, chanName)
if message ~= nil then
local mas = {"!mop","!mists","!pandaria","!panda"}
for i=1,#mas do
local startPos, endPos = string.find(msg,mas[i]);
if startPos ~= nil then
if string.sub(msg,startPos,endPos) == mas[i] then
if chanNumber > 0 then SendChatMessage(Report,"CHANNEL",nil,chanNumber) else SendChatMessage(Report,"GUILD")
end
end
end
end
I try to use this and can hook/send message to any channel, but I don't know how to distinguish message from SAY from message of GUILD