refactor bot code to include action queue