President Obama gave rap singer Kanye West a little advice at a Democratic National Committee event held in San Francisco Saturday.

Speaking to a crowd of around 1,300 people who had paid up to $10,000 to see him, Obama subtly referenced Republican presidential front-runner Donald Trump as he gave West advice on running for office, according to pool reports.

"You got to deal with strange characters who behave as if they are on a reality TV show," said Obama. "Saying you have a beautiful dark twisted fantasy — that's what's known as off message in politics," he said, alluding to "My Beautiful Dark Twisted Fantasy," a West song.

Kanye West has said he plans to run for president in 2020. After the tumult in the House of Representatives, some reports mentioned him as a potential speaker. A speaker need not have held elected office.

Commenting on the reports West might run for speaker, Obama cracked that the legislative body "couldn't get any stranger."

"Do you really think this country is going to elect a black guy form the south side of Chicago with a funny name to be president of the U.S.?" Obama joked, before asking the "rowdy" crowd to settle down.

In prepared remarks, Obama defended his domestic and foreign policy record and told the crowd there was more work to do, according to pool reports. His remarks were very similar to those he made the previous evening.

Obama also attacked the GOP's resistance to climate change, calling it "funny if it wasn't this big existential problem."

When he spoke about gun control, he received the loudest applause from the San Francisco crowd. "We've got to make a different choice," he said. "We've got to make a different choice."

Kanye West performed at the DNC event and the Golden State Warriors, with their NBA championship trophy, also made an appearance.

"To see everyone supporting our president and the future of our country is definitely a huge thing," said Stephen Curry, the NBA's MVP and star guard.

Despite Saturday's advice, Obama has repeatedly called Kanye West a "jackass" in the past. The first time was after West interrupted Taylor Swift's acceptance speech at MTV's VMA awards in 2009. A few years later, Obama repeated the perjorative to describe the controversial rapper to the Atlantic, saying that he prefers the music of rapper Jay-Z.