I never attend work parties anymore. They are not worth the stress, and in the end, it didn't help me to be there, either.
In the days that I tried, people were complaining that I left too early and wasn't enjoying myself enough. They were quite seriously offended, actually. They had no right to be, but they were. I was actually told I should stay away if I leave after an hour and don't drink [myself into a coma].
They're also offended now that I don't attend. These are a number of different workplaces, but you're not going to make everyone happy anyway.
I don't make excuses. I tell them I won't be attending. Some of the 'invites' are so aggressive that they're actually offending me, such as opt-outs rather than opt-ins (i.e., 'let me know if you aren't coming' as opposed to 'let me know if you can come').
I work for the sake of staying alive. I don't work to make friends. My steady-income work couldn't be wronger for me if I tried, but I need it for food, roof, clothes, social security and health insurance. I don't want to deal with it or the people associated with it for one second longer than I have to. The quality of my work is excellent, I make sure of that; so when people get stabby because I'm not making my work my life, I've learned to push back somewhat aggressively that there's nothing in how I do my job that provides them with grounds to reprimand me.
I do tell them that I come to work to work, not to make friends or to socialise.
It does mean that I really have to watch what I'm doing. Many co-workers are quite happy to blow the tiniest misperception entirely out of proportion to find fault with me on the only grounds they can - professionally. Intentional misunderstandings and misperceptions tend to go up exponentially when you tell people that no, you're not their friend, you're their colleague - even though you haven't harmed them in the slightest and may actually be quite pleasant and helpful to deal with in your professional role. They've even tried to invent mistakes when they thought I didn't have the papertrail to refute their allegations. It was a fluke that I did. Their allegations were excused as a misunderstanding. It wasn't.
Since it would be difficult to prove a negative, I've since switched to getting everything in writing whenever possible, however minor it seems. And when they refuse to 'go on the record', I get very suspicious, and they get a follow-up email going back over what was said, in which I explicitly ask them to reply in writing if my account doesn't match their understanding of things.
But considering I couldn't get my job done if I spent half of the time on it socialising, and that I'd feel even more drained if I did, plus the work-dos that it would take me about two days to recover from each time - just to get back to my normal exhausted self - doing things this way is still the better option for me.
Besides - I have a life outside of work and colleagues. That life has a schedule too, one that I don't even set. Evening classes don't care that your day job colleagues would just love to do some s*** or other. You'll miss classes that you've paid for if you don't attend. You might even fail out of courses. Other groups, like choirs (but could be anything) that may not cost you still have practice times that are usually meticulously adjusted to fit everyone's schedule as best possible, and can't be blown off everytime someone at work thinks it would be a great time to get s***faced after hours with the supposed social circle that they lazily assume work provides them with.
It's called life - you're allowed to have one.
And finally, I'm very wary of people who lock themselves into such small echo chambers as to work and socialise with the same people. They get so little feedback from outside these circles that their minds tend to shrink, no matter how educated they may formally be. Going by everything I've experienced and read, your mentality, thoughts and attitudes are very greatly influenced by your environment. When that environment begins and ends with the ten or so people you work with, you're living a very limited life. If people do that of what is presumably their own free will... well, you're letting them.
But their rights end where your nose begins, and they don't get to dictate your life to you. This is a passive right - they may live that way if they find willing participants. They don't have the active right to be provided with participants in that lifestyle if they find none.
After all, selfishness isn't living the way you want to, it's demanding others live the way you want to.
Doing your actual job is what should matter to your job.