(CNN) — Roseanne Barr blamed the sleep aid Ambien for a series of racist tweets that resulted in the cancellation of her show “Roseanne” by ABC on Tuesday.

Barr tweeted, “guys I did something unforgiveable so do not defend me. It was 2 in the morning and I was ambien tweeting.”

In another tweet, Barr doubled down, saying that she has “done weird stuff while on ambien-cracked eggs on the wall at 2am etc –“

Ashleigh Koss, a spokeswoman for the North America region of Sanofi, the maker of Ambien, said in a written statement Wednesday, “While all pharmaceutical treatments have side effects, racism is not a known side effect of any Sanofi medication.”

The claim drew questions and backlash from social media, with one writer and correspondent for the TV show “Full Frontal with Samantha Bee” saying, “Ambien makes you racist? No wonder some of y’all can’t get woke.”

As for whether Ambien could be to blame for Barr’s actions, Dr. Nancy Collop, medical director of the Emory Sleep Center, wrote in an email, “I really don’t think so.”

“Writing a coherent tweet is not what is usually seen” during abnormal sleep behavior, she said. In contrast, the types of movements you’d expect to see, like walking or eating during sleep, “don’t require a lot of thought.”

“I wouldn’t say it is impossible but I think her history of prior racist comments suggests conscious decisions were made … not related to the use of a drug,” Collop said.

Another sleep researcher said she has encountered some patients who have texted in their sleep. These patients “may send things that don’t make sense,” Dr. Rachel Salas, associate professor of neurology in the sleep medicine division at Johns Hopkins Medicine, wrote in an email. “But some have sent coherent texts without remembering.”

“Ambien does not induce ‘racist tweets,’ ” she added, “but it is possible that people could text or tweet while on Ambien and not remember.

“My advice for people is not to sleep with your phone or electronics near your bed when on sleep aids, and to put a passcode on your phone to make it more difficult to send texts, tweets, or make purchases.”

WHAT OTHERS ARE CLICKING ON:

>>MORE STORIES