Trevor Noah didn’t know he was suffering from depression until Jim Carrey opened up about his own mental health struggles.

While accepting the Comedy Person of the Year Award at the Just For Laughs comedy festival in Montreal on Friday, the “Daily Show” host took a moment to thank Carrey, who also attended the event.

“You can’t win at comedy. Every comedian knows, you’re going to have your good days, you’re going to have your bad days, but you don’t win,” he said. “Winning is getting to the end without committing suicide, and Jim Carrey was one of the first comedians that described the beast that many of us face in this room and that’s depression.”

He continued, “I didn’t know what that thing was. I just thought I liked sleeping for weeks on end sometimes, and then I read [Carrey’s] story and I was like, ‘Oh s–t, that’s what’s going on,’ and I thank you because, you know, I found a way to fight it. I found a way to build a community and that’s what this place is, it’s a community of people trying to do something.”

In an interview with CBS in 2004, Carrey opened up about his struggle with depression, saying that he had been on Prozac for a long time.

“I had to get off at a certain point because I realized that, you know, everything’s just OK,” Carrey said.

In March 2016, Noah talked about his battle with depression on “The Daily Show” while interviewing comedian Neal Brennan.

“You know what’s funny about [depression], though, is people go, ‘If you’re depressed, you can’t smile, if you’re depressed you can’t tell jokes,’ but as comedians that’s like the one thing most comedians share is that monkey on the back of depression,” Noah said.