The Montreal Canadiens passed one million Twitter followers Tuesday and used an automated Twitter script to celebrate the occasion with their fans. The idea was simple. Anyone who tweeted at the team with the #CanadiensMTL1M hashtag would get one of several customized replies. There were customized images, video messages from several players, and even a personalized Habs jersey. The idea may have been great on paper, but the result was a disaster.

Anything automated can quickly lead to trouble. That's because there will always be loopholes and people eager to exploit them. The Canadiens Twitter account proceeded to rack up thousands of tweets around the occasion. Eventually, loathsome Twitter users began to take advantage. The results ranged from juvenile jokes to repulsive racial slurs.

Note: There is offensive language in the screenshots below.

That alleged Maple Leafs fan sure showed them with that joke.

While obnoxious, that sadly doesn't even register on list of the worst users exploiting the automated script. While there is likely a filter in place to remove some offensive terms from the automated system, there are many ways around it. Replacing a letter with a number will do the trick. That allowed a number of abhorrent slurs to slip through and even make their way onto the customized jerseys.

Similar tactics were used to generate a wide range of replies.

P.K. Subban was a target of the troll accounts. He was also one of several players to participate in thank you videos to followers. That led to some unfortunate situations in which the Canadiens would reply to an offensive account that used a racial slur with a video of Subban thanking the account for being a follower.

This wasn't the case of an actual human Canadiens employee tweeting these replies. The team tried to do a fun thing for its fans and underestimated the results. If there is any error by the team, it was not learning from similar campaigns. The New England Patriots also utilized an automated script to celebrate one million followers with their fans. It led to the team apologizing after a racial slur slipped through. The Canadiens campaign devolved even further, with too many replies to offensive accounts to even count. Eventually the Canadiens became aware of the issue and issued an apology.

Automated messages were sent from our account tonight resulting from a filtering issue in our campaign to thank our 1M Twitter followers. — Canadiens Montréal (@CanadiensMTL) February 24, 2016

We apologize for the offensive messages and have fixed the issue so it won't happen in the future. — Canadiens Montréal (@CanadiensMTL) February 24, 2016

The entire fiasco was another sad reminder that if you give people the chance to be repugnant, they will be repugnant. Even if it's under the guise of a prank or whatever they say to justify being terrible and offensive.