Eating chocolate during period

I cant stop thinking about chocolate when my period starts . So I ruin my whole diet plan and feel guilty. What do you recommend me to do to stay away from chocolate or sugary stuff ?