BANGKOK — Once again, a Thailand hotel guest who posted complaints online faces the threat of a defamation charge. This time, it centers on the guest’s claim of cockroach legs in his macaroni.

Topp Dunyawit Phadungsaeng, who spent 14 days in coronavirus quarantine at the Ambassador City Jomtien Hotel after arriving last month from San Francisco, had plenty of time on his hands to record complaints about the quality of the food, the lack of cleanliness and the presence of bugs.

On Monday, after checking out, he posted on Facebook about his stay, including 46 photographs and four videos that he took of the hotel, a government-designated quarantine facility. His posts were widely shared, especially a photo of what he said were the legs of a cockroach in his stir-fried meal.

“It turned out to be the worst 14 days of my life,” he said in his post. “Don’t call this quarantine. A forced prison stay looks better than this.”

His complaints were widely picked up by the Thai news media. And a day after his post appeared, the hotel issued a statement calling on a “certain group of people” to stop posting “false information” with the intent of damaging the hotel’s reputation. Otherwise, the hotel said, it had the right to pursue civil and criminal charges “to the utmost.”

Because of the coronavirus, anyone coming to Thailand must spend 14 days in quarantine. The government will cover the cost of some hotels, including the Ambassador City Jomtien, which is near Pattaya city. Guests can pay to stay at higher-end hotels, including some with five stars, that are designated quarantine sites.

Mr. Topp said he regretted not paying for better lodging. Among his complaints were that his room had no Wi-Fi but plenty of mosquitoes and cockroaches. Water dripped from the ceiling, bedsheets were moldy, and he was served food that was sometimes inedible, he said.

“I didn’t expect it to be a luxury five-star hotel,” he wrote. “But have you ever been disappointed despite not having any expectations?”

In September, an American hotel guest was arrested and charged with criminal defamation after posting complaints on TripAdvisor about his stay at the Sea View Koh Chang resort on Koh Chang island.

The guest, Wesley Barnes, eventually made a formal apology in exchange for the hotel’s dropping the charges. But the Sea View’s strategy backfired. It was widely criticized on social media, and TripAdvisor posted a notice warning travelers that the hotel was behind the jailing of a guest for harsh reviews.

A spokesman for the defense ministry, which has a role in overseeing quarantine facilities, said he hoped Mr. Topp and the Ambassador City Jomtien Hotel resolve their difference.

“In this case, it is the right of the reviewer,” said the spokesman, Kongcheep Tantravanich, “but we would also ask for sympathy for the hotel owners.”