Moved lottery function code over to commands.js