User blog:Ninjadark27/A bot

How do I create a bot? I am looking for one that can give you chat logs and stop users from spamming messages. Thanks!