Edited from https://github.com/banjaxe/CloudBot