Katy Perry once offered Bebe Rexha tips on how to deal with online trolls.

The pair have grown close since Bebe was tapped as the opening act for the Brazil and Peru shows as part of Katy's Witness: The Tour in March. The duo have both received nasty social media messages in their time, but luckily the Firework hitmaker knows exactly how to handle the haters.

"I was at dinner when I was on tour with Katy Perry and went on my Twitter and was reading the comments and got really bummed about what somebody had said," Bebe recalled in an interview with news.com.au. "She was like 'Why are you reading the comments?' That's the number one rule, don't read the comments. Because you will see someone telling you you're fat, and ugly, and you should die, and you'll think 'Oh my God, is that true?'"

The Meant to Be hitmaker attracted significant online criticism following the release of Rita Ora single Girls, which featured Bebe in addition to Cardi B and Charli XCX, after members of the LGBTQ community accused the singers of using lyrics which appear to trivialize sexuality. Following the backlash, Bebe told EW that she "felt disrespected" and noted that "singing a song about kissing girls… remains true to who I am."

Nevertheless, the 28-year-old admitted that the situation has consequently made her more aware of her actions and the way they can be perceived by the masses.

"In general, a lot of the things I do now have to (be) very thought out, especially a situation like that," she shared to news.com.au. "You do what's true to you, what you believe in and you love but you can't ever please everybody. That's why you gotta stay off the Internet."