Shortly after President Donald Trump tweeted on Tuesday that he'd served fast food — specifically, some misspelled "hamberders" — to the college football national champion Clemson University Tigers at the White House, Burger King lobbed back.

The chain tweeted, "due to a large order placed yesterday, we're all out of hamberders. just serving hamburgers today," and the side helping of snark took on a life of its own.

It's cheeky messages like those that are giving some fast-food chains an alter-ego on social media. Yes, they are almost always self-promotional, but the messages are often witty and clever enough to give personality to otherwise faceless companies. And that can drive sales.

Many of the tweets are strictly business, but some aren't afraid to zing, offering quips that mock competitors or pick up on news events, causing a stir among fans.

More:Sears, Kmart may survive: Eddie Lampert wins Chapter 11 bankruptcy auction

More:Why you could pay more in income taxes and for shopping online in 2019

More:How the gender pay gap hurts women's retirement and 401(k) plans

In an e-mail on Wednesday about the hamberders tweet, Burger King explained it "just wanted to have some fun with the situation."

"Burger King has a pulse on pop culture and therefore socially, we aim to participate in trending conversations that are happening in real time," the company said. "We like to playfully joke around with what the Internet and news outlets are saying, but never to be mean spirited."

Behind the scenes, fast-food chains now have their own writers' rooms, akin to the teams that bang out dialogue for TV comedies or hash out ad copy. Only these teams work on Twitter, limited to 280 characters and always aware of the challenge of being creative without embarrassing the brand.

The goal, just like the fare on their menus, is to satisfy Twitter-hungry fans think it's a mano-a-mano dialogue with a company they now think of as their friend.

Wendy’s is among the most aggressive with a take-no-prisoners Twitter feed. Others, such as Del Taco, peek out from time to time with a well-placed blast of humor.

"Twitter itself is a very modern and direct way to talk one-on-one with people," said Wendy's chief marketing officer Kurt Kane. "It’s always a way to have a lot of fun and engage in a lighthearted way."

For example, In July, a fan of Wendy's expressed surprise via a tweet that the chain offered chicken tenders, and Wendy's, on its official Twitter account, replied, "Oh, it happened, and we still got ‘em. You just gotta get ‘em."

The Dublin, Ohio-based company's social-media team consists of five men and women in their 20s and 30s, plus an outside advertising-marketing agency. Perhaps not surprisingly, one moonlights as a stand-up comic. The cute-without-being-cutesy quintet have a variety of interests from pro wrestling and movies to fashion and music, which enables them to think outside the box – and toward a punchline.

The group meets often to discuss what social-media ideas they like and don't like. In the case of an unexpected jab from another chain, the timeline is sped up, like the response to IHOP's faux-name change in June and McDonald's nascent embrace of non-frozen beef in March.

Wendy's Twitter voice was honed by a woman named Amy Brown during her 2012-2017 tenure. Over time, she discovered that the best quips -- after "internal back-and-forth whether to respond" -- came from reacting to others in the Twittersphere.

"A user started saying, 'Wendy’s, do you have anything to say about this?,'" recalled Brown, now the social media lead for the food delivery company Postmates.

A witty jab on Twitter at just the right moment is key. The snarkier, the better. Knives are drawn – but because it’s fast food, they're made of disposable plastic.

All were at their best – or worst, depending on how you see it – in doing their best to steal thunder from IHOP's June promotion in which it pretended to change its name to IHOb, with the "b" standing for burgers.

Wendy's taunted: "Remember when you were like 7 and thought changing your name to Thunder BearSword would be super cool? Like that, but our cheeseburgers are still better."

Kane called it "a tongue-in-cheek way of saying we don’t think IHOP is committed to serving great quality burgers."

Brand awareness via those moments on social media has bottom-line value -- with little expenditure.

"What did it cost Wendy's to respond? What did it cost Chili's to respond? Nothing," said Peter Shankman, author of Zombie Loyalists: Using Great Service to Create Rabid Fans. "It allowed them to piggyback. They didn’t have to do any work."

The approach seems to work. Aaron Porter of Mobile, Alabama, started following Wendy's on Twitter, because he found the brand entertaining.

"When they started picking up their social media game, I started going to Wendy's more. They were more on my mind," the 35-year-old video editor said. "I'm more likely to go to a Wendy's, because I've had such good experiences with them online."

Burger King's response to the IHOb switcheroo was more subtle than the Wendy's bite. It temporarily changed its name online to Pancake King. Other chains piled on.

The snappy, sometimes snippy, tone makes it an especially good fit for the informal dining sector. Taking social swipes at one another is OK from brands known for wacky spokespeople and decades-old advertising wit.

"If I go in for Lasik surgery, I don’t want my doctor to be really hilarious," Kane of Wendy's said. "When it comes to quick-service restaurants, they’re a lighthearted category."

That's why restaurants are paying attention to Comedy Central, not the Food Network.

"If you're not driving revenues, at end of the day, the CEO doesn't care," Shankman said. "Does it drive enough to pay for the 26-year-old kid who's handling the social account? Sure."

Follow USA TODAY reporter Zlati Meyer on Twitter: @ZlatiMeyer