To read chat messages, you need to
1. Create a frame if you don't already have one.
2. Register the frame for the chat event (or events) that you want to watch.
2a. See
http://www.wowwiki.com/Events/Communication for a list.
2b. See
http://www.wowwiki.com/Events if you need more information on the event system.
3. Create an event handler along the lines of:
Code:
function me.EventHandler(self, event, ...)
if event == "SOME_EVENT" then
local msg, sender = ...
--do other stuff
elseif event == "SOME_OTHER_EVENT" then
local msg, channel, language, sender = ...
--do other stuff
end
end
3b. The specific parameters for each event are described on the wiki page that I linked above.