User blog:Meyguhmein/How to make a bot?

How can I create a ChatBot like this one? I want a bot to watch over my wiki's chat, so that it can record all spam chat messages when the users are not around.