I have been having frequent attacks of anxiety/panic lately (was in therapy for this for a while). Yesterday evening I had an attack and in the midst of it, at one point I had the thought “I hate God.”

I immediately told Him, “No, Lord, I don’t hate you, I’m sorry and I don’t know where that thought came from.” But now I’m afraid. I was planning to go to Mass today. Should I not receive Communion?
It definitely was not full consent. How can you be giving full consent to a thought if you don’t want it in your head and reject it the instant it turns up?
If you
deliberately thought this thought, freely and not under pressure, then that would be full consent. It sounds like the thought just crossed your mind and you rejected it immediately. If you had assented to its presence out of weakness while under pressure, that would be venial sin but not mortal, for you would not have been giving the thought full consent. But if you don’t even assent to the thought’s presence
at all but reject it immediately, there’s no way that’s full consent. It’s not
any kind of consent, for consent is in your
Free Will decisions, not in what happens to plop into your mind. The Catechism points out that full consent can only be given when you do what you do
deliberately. You did not think, “I hate God” with free and deliberate desire and choice. The thought was just in your head, and you rejected it right off, just as you should. That’s not a sin at all.
If you had assented to the thought’s presence out of weakness and under interior or exterior pressure, because being under constraint reduces culpability, you would have committed venial sin, not mortal. But if the thought crosses through your mind and you reject it immediately, as you did, there is no sin present at all

. You glorified God in your choices.