nail went in hand pain

My friend shot a nail through his hand with a nail gun it is swelled in bad pain but he can wiggle his fingers so its not broke kinda brushed hot and it hit the nuckle what’s can we do for it