"Harry Potter" series author J.K. Rowling told her fans that there have been LGBT students at Hogwarts.

The author took to Twitter to respond to a fan, @claraoswiin.

"@jk_rowling do you think there are a lot of LGBT students in modern age Hogwarts? I like to imagine they formed an LGBT club," the Twitter user said.

Rowling responded to the tweet.

"But of course," she said, attaching a picture that reads, "If Harry Potter taught us anything, it's that no one should live in a closet."

In"Harry Potter" there is a part where Hermione fights for house-elves' equal rights, and Rowling has said she considered Albus Dumbledore gay after the series ended, USA Today reports.

The Independent reported that Rowling revealed the headmaster's sexuality back in 2007.

"It has certainly never been news to me that a brave and brilliant man could love other men," she said at the time. "He is my character. He is what he is, and I have the right to say what I say about him."

Entertainment Weekly talked about Rowling's Twitter response and received a few comments from readers, some disputing the actual diversity of the series.

"Except that many of these groups aren't represented in her book," Guest37 wrote. "It's like saying, no of course there were lgbt, blacks, and asians who were best friends with the characters of Friends. They just had their interactions off screen so you didn't see it. It doesn't count as representation if you have to backtrack and say, no those groups were totally present in the fictional world, they just happened in the background and are never mentioned."

Robert Denton agreed

"J.K. Rowling waited until her story was concluded to reveal a major character was gay," he said. "It might have been more inspiring to gays if this had been revealed while the story was ongoing. But I guess book sales come before one's principles."

Rowling's series portrayed diversity through certain characters like mudbloods and wizards working together but some still having animosity towards the other, such as some issues in the U.S.