Refactored the file to better follow PEP.
Made the bot put posts in contest mode.