A generic bot-writing framework