Just remember this - just because you cut this one time doesn't mean you have to cut again. Don't start thinking of yourself as a cutter because then you'll keep doing it for sure. I have the same exact kind of panic attack sometimes when I'm in a social setting or about to be in one, to the point where I literally can't stop myself from scratching my wrists with my nails. I think its mainly because when you hurt yourself, endorphins are released which can make you feel a sense of relief and even pleasure when you cut. Try to do something else that could make that happen. For example, forcing yourself to smile will release endorphins which could help. Or you could pinch yourself or something like that.
Don't be friends with those people! I completely know the feeling you got before you cut. It's horrible and nothing helps it other than cutting, it seems. And I can't really tell you what to do to keep from cutting because a lot of the time the consequences of doing it aren't as bad as the consequences of not doing it (if that makes sense). But it seems like those people you consider friends stress you out and make you miserable so just don't hang out with them. Tell them to go to hell and have fun on your own. That should be a step in the right direction c: