The conversation usually goes something like this:
Me- I'm allergic to caffeine. It makes me get a terrible headache, then get really sleepy and sleep for 12 hours and then I still have a terrible headache.
You- Um, but I see you eat chocolate all the time. You're always talking about chocolate and writing about chocolate. You are a total chocolate adict.
Me- Yeah! I love chocolate. It's my main drug.
You- Um, but chocolate has caffeine.
Me- Well, it has a tiny bit, but mostly it has other closely related chemicals.
I've had this conversation with enough dozens of people that I figured I should look up what was in chocolate. And it turns out I actually did know what I was talking about (for once). According to this article in the journal European Food Research and Technology, cacao beans have three main kinds of very similar chemicals in the group called methylxanthines. These are theobromine (named for the Cacao tree, Theobroma cacao), caffeine, and theophylline. Raw fermented beans straight off the cacao tree have lots of theobromine, very little caffeine and almost no theophylline. In the various preparation steps between then and when I actually eat it, much of the caffeine is lost. The concentration of these various chemicals depends a lot on the strain of cacao, the growing conditions and the processing, but most chocolate has 20 to 100 times as much theobromine as caffeine. A cup of hot cocoa has about half as much caffeine as a cup of decaf coffee.
The fact that chocolate doesn't make me have a terrible headache and put me to sleep is likely (likely meaning I am speculating) either because there is too little caffeine in it to matter or because it has so much theobromine. Theobromine could be counteracting the caffeine, or it could be competitively excluding the caffeine from the neuroreceptors it normally binds to. Basically this means that theobromine and caffeine are so similar that they stick to the same spots on my neurons, and if the theobromine gets there first, the caffeine may not be able to stick, and therefore not affect me. But the moral of the story is I can eat chocolate without worrying about the caffeine making me sick.