Shyan Wright wanted the 23-year-old to hide the gun because her "yard ain't hot", meaning police were not aware or interested in her home.
Wright, from Walsall, typed "God forbid the children getting closeâ€¦Lol" when the woman said she had stashed it and eight bullets in her room.
Wright, 25, was jailed for five years.
She denied aiding and abetting possession of a firearm but changed her not guilty plea to guilty at Birmingham Crown Court on Monday and was sentenced.
More updates on this story
Wright, from Forrester Street, asked her friend, whose children were aged two and three at the time, in a series of messages on WhatsApp in May 2015.
Using the name ShyShy, she said: "I need a big favourâ€¦me and my baby father was wondering if you could hold onto a [gun emoji] for a bit. Ur only one I can trust.", West Midlands Police said.
Three days later, she asked her where she had hidden it. When the woman confirmed "in Ma room", Wright joked about her children stumbling across it.
Officers raided the friend's home weeks later and recovered the weapon. She was subsequently jailed for five years, West Midlands Police said.
Detectives did not discover who ShyShy was until a wider gun crime investigation last year uncovered intelligence on Wright.
Her home was raided on 2 November when another phone was recovered that was shown to have been used in the WhatsApp conversation.
Det Con Damian Forrest, said both women had "found to their cost the catastrophic consequences of holding on to firearms for someone else".
He added "The messages 'laughing out loud' about what might happen if they '[the children] found the loaded gun are truly shocking and sickening."

They agreed to a government proposal to extend Stormont's talks until 29 June.
During the debate, the secretary of state also confirmed plans to provide legal authority for a Stormont budget, if the parties cannot reach a deal.
Stormont has been without a devolved government since January, when a coalition led by the DUP and Sinn FÃ©in fell apart over heating scheme scandal.
The Ministerial Appointments and Regional Rates Bill gives the parties more time to negotiate after the general election on 8 June.
It also allows rates to be collected in the absence of a devolved government.
It took just under four hours for MPs to discuss the legislation proposed by Northern Ireland Secretary of State James Brokenshire.
He argued that his bill provides the scope and space for the local parties to strike a political deal.
But proof that the government is planning for failure as well as success came in his confirmation that he has been talking to senior civil servants about the budget for the current financial year.
If implemented, Mr Brokenshire's indicative budget position will provide certainty, but a projected 2.5% cut to the education budget will undoubtedly cause concern.
The debate in the House of Commons was wide-ranging, touching on issues like the Irish language, same-sex marriage, the military covenant and Brexit.
The House of Lords will debate the bill on Wednesday and then the legislation, which is being fast-tracked through Parliament, should become law by the end of this week.
A woman persuaded a friend to hide a loaded gun in her home and joked over WhatsApp whether her two young children might find it.
[NEXT_CONCEPT]
MPs have passed a bill delaying the deadline for Northern Ireland parties to reach a deal to restore devolution.