Pastor yelling at me for asking someone questions about something I wasnt invited to

I am so upset, I feel like my friend and pastor dislike me and want me to stay away from them because my friend said she needed space and was yelling at me for feeling excluded bc Im not invited places and thinking Im being rejected when that is supposedly not true.
My pastor messaged me telling me I need to stop being offended when I don't get invited to things after he overheard me asking someone at church about a get together they had. And he said if I wanted to stay part of the group I need to stop asking people questions about their events that Im not invited to because it makes it look like Im upset that I wasn't invited. Ok I understand that but why is he making me out to be this horrible bad person and threatening to kick me out for simply asking what someone did when for clarification when I overhear them talking about a get together.
Find another church.
Right as I read pains my heart BC I've experienced this too.. Like ASUK reccomended...

Get out! Any place that doesn't treat you with dignity isn't a place you need to be...

It isnt a test of faith, but of common sense... People like that rarely change...especially if the pastor is acting like that..

Take it from someone who has experienced that and worse..

Leave before your faith is marred by their hypocrisy and actions.