David Walker, 28, underwent emergency surgery following the March 6 incident in Dinnington, northern England. Tests were continuing to find out how it would affect his fertility and future sexual relationships, his lawyer Gulzar Syed said.
"He still feels quite severe pain," Syed told Sheffield Crown Court, adding that some pellets remained in Walker's scrotum.
Walker admitted to one charge of possession of a prohibited firearm at a previous hearing.
Prosecuting lawyer Andrew Hatton told the court how Walker had gone home to get the shotgun after arguing in the pub with lifelong friend Stuart Simpson about whose turn it was to buy a beer.
As he was returning to the pub, which had closed by this time, he accidentally fired the weapon.
"He had it shoved down his trousers," Hatton said. "After the shotgun had discharged he placed it in a rubbish bin and crawled back to his home address."
Walker told officers he was so drunk he had no idea how he managed to shoot himself and why he went to fetch the weapon.
Judge Robert Moore said recent legislation regarding banned guns meant he had to impose the statutory minimum sentence on Walker of five years in prison.
"The shooting of yourself is plainly an exceptional circumstance which is capable of reducing the sentence," Moore said. "But in this case, I am quite certain, it does not justify reducing it below the statutory minimum."