How to get message body in openfire plugin

I used the motd plugin and modify it to send a custom message as soon as a user login.

Now I want to parse the content of the message in the plugin and accordingly take some action, like send some warning message if user is using abusive language etc.

The problem I am facing is I don’t know how to capture the message in the body and parse that.

Any hint or help will be highly appreciated.

Also Please let me know if this is not clear .

Thanks in advance.