createBot function