Implemented the chat message script API.