It depends on the severity of your eyes. If your eyes are swollen badly and it has already affected your daily life, for example, you can't see things clearly or your eyes hurt too badly to open them, you can ask for a leave. I think swollen eyes just affect your look, if you don't care, it won't be a huge matter. Then let me analyze swollen eyes for you. The swollen things usually happen on people whose blood circulatory and metabolic capacity is bad. These people used to drinking a lot of water before sleep, sitting for a long time and staying up late and eating spicy food. Gradually, the water in the body cannot be excreted out. Then, their eyes or faces will swell. To cure it, you can cover your eyes with cool towel for a few minutes .If you use cotton pad soaked into ice tea to cover your eyes, the treatment effect will be better.
To be honest, this is more of a moral problem. The answer is up to you.
But I do suggest you stay at home, as your eyes got swollen. It is not only ugly, but also a symptom of a certain discomfort of your eyes. You need time for your eyes to recover.
If you get the swollen eyes, I suggest you to stay at home instead of going to school and have a treatment for the eyes. If it is not that serious, you could use the warm compress home remedy to treat your eyes. You could find the clean cloth and hot water to do this. It will be so workable and effective which you could have a try.