CBT is however about fixing negative thought patterns. Start of chapter 3 of Feeling Good (I just pulled open the pdf) Burns says 'Illogical pessimistic attitudes play the central role in the development and continuation of all your symptoms'
I don't think I myself have posted about this before, and just did a search. Hacker news does seem to be often dismissive of the psych field though, as there is not a lot of good science that would appease a critical thinker.
But it doesn't matter what causes the emotions - CBT helps people deal with negative emotion no matter how they're caused. Pain management in cancer patients is a good example where emotions are caused by something external but where CBT is still effective.
You might want to have a look through some better books or websites to get an idea of what modern CBT involves.