There is not proof it was by a foreign government afaik. Though from the reporting I've read it does seem to be murky at a minimum, and not proven to be as clear as top comment-or said. Doesn't matter though.
That specific context you mention is VERY important:
Russia already did this.
The FBI specifically warned to TW that a leak like this had high chance of happening just at the time it did.
Twitter was right to be cautious.
Maybe didn't do everything consistently or perfectly, but I would far prefer them limiting the reach of Hunter dick pics and crack photos than letting a foreign government do so much damage again.
I think their main error was being slow as more background & info was uncovered.