PITTSFIELD — There's bad luck, and then there's really bad luck.

A North Adams man apparently learned that the hard way when he allegedly unwittingly set up a drug deal with a North Adams police officer when he sent a text message to the wrong number.

Christopher A. Letalien, 34, was arraigned in Berkshire Superior Court on Monday and pleaded not guilty to one count of possession of a Class B drug with the intent to distribute. The count is being charged as a second offense.

According to court files, a member of the North Adams Police Department began receiving texts around 5 p.m. on Dec. 11 from an unrecognized number apparently offering Ritalin for sale. The sender identified himself as "Chris," and said he was a former tenant of the person he was trying to reach.

"It's Chris. Not wanting to start any trouble, but was wondering if you wanted any Rids," one of the messages read.

"Chris" said he had 20 milligram Ritalin tablets for sale at $5 apiece.

The officer told "Chris" he'd be in town around 6 p.m. and wanted all the pills he had available. Police made arrangements to meet the person offering the drugs at the intersection of Liberty and North Holden streets.

Letalien was at the meet and opened the passenger side door of an officer's car and realized police were inside. "Oh, [expletive]," said Letalien, according to police.

Police found Letalien carrying a pill bottle with 16 Ritalin tablets inside and placed him under arrest. Letalien told police he was hurting for money and was trying to sell his medication.

At his arraignment, Letalien was ordered held on the same $2,500 bail set for him in Northern Berkshire District Court.

He is due back in court May 28 for a pretrial hearing.

Bob Dunn can be reached at bdunn@berkshireeagle.com, at @BobDunn413 on Twitter and at 413-496-6249.