In the last few weeks, Lena Dunham has finished shooting the second season of the hit HBO show Girls, which she created and in which she stars, and which was nominated for five Emmys ("where they don't give you any food or water for four hours"). Proving that success comes in threes, on Monday Dunham, 26, announced she has signed a book deal worth more than $3.5m.

Random House secured her forthcoming advice book – Not That Kind of Girl: A Young Woman Tells You What She's Learned – after what by all accounts was an energetic tussle between publishers over the 66-page proposal.

Her book is set to contain personal essays about sex, mortality and food. According to the New York Times, a chapter in the proposal reads: "Red lipstick with a sunburn: How to dress for a business meeting and other hard-earned fashion lessons from the size 10 who went to the Met Ball."

In front of an audience made up of enough twentysomethings to fill a Brooklyn warehouse party, Dunham discussed her book with television critic Emily Nussbaum at the New Yorker Festival on Sunday.

Dunham told Nussbaum that she is a frequent consumer of advice books and has read He's Just Not That Into You as well as Be Honest – You're Not That Into Him Either.

"I didn't take either of them seriously, but I was so fascinated by the person who felt like they had gotten to a place where they were literally a dating pro," Dunham said. "That idea, that you could master the most mysterious emotion and write a book about how to handle it properly."

So what advice would Dunham give to the lead character – played by herself – of her Emmy-nominated show, which is based on the lives of 20-somethings in New York?

"I know she's a mess and she's exhausting and those things but I think her unsinkable Molly Brown quality will serve her well," Dunham said. "She just needs to let her freak flag fly."

Dunham kept under wraps most of the details of season two of Girls – which has finished shooting, and airs in January. But she confirmed that Chris O'Dowd – who played Officer Nathan Rhodes in Bridesmaids and was last seen on Girls marrying the much-younger Jessa – will return. She said Community's Donald Glover was also joining the cast.

It is safe to say that Dunham will employ some of her trademark nudity in season two, which she admitted was a directorial crutch.

"I definitely have a tendency to be like, this scene is not exactly what it should be, I'm gonna take off my pants," Dunham said.

Nussbaum and Dunham also talked about the negative attention the show has received. People have accused Dunham and her cast of nepotism, and criticized a lack of diversity in the show.

Dunham's parents are both well-known members of the art world and the girls of Girls are all children of famous parents. Zosia Mamet (Shoshanna) is the daughter of playwright David Mamet, Jemima Kirke (Jessa) is the daughter of former Bad Company drummer Simon Kirke and Allison Williams (Marnie) is the daughter of newscaster Brian Williams.

"I have plenty of counter-arguments to that, but it's not elegant to share them," Dunham said. "Like it's not classy to go on Twitter to say, 'I had to have summer jobs since I was 12.' It's not a cool move, so I didn't do that, but I sort of stewed with them."

Dunham, who was born and raised in New York City, said she couldn't argue with criticisms that there weren't enough minority characters on the show to realistically portray her hometown.

"That is a real criticism and that is something I've thought about and I didn't claim to be making a perfect mirror of the life of young New Yorkers … if I in any way accidentally made that promise, than mea culpa."

She said she had studied race and gender politics at her notoriously liberal alma mater, Oberlin College, and that defending more severe criticisms about the portrayal of race on the show is a losing battle.

"What I didn't like was the other angle, that there isn't enough minority characters on the show, but, therefore you are racist, you were raised by racists, you come from a world where people don't think about class or privilege and you have a broken relationship to the world around you," Dunham said. "That is hard to hear and it's upsetting."