extracted bot behaviour into seperate js file.