From e1500cf92c6df9896a6aa7e1f7a2b45492c7f20a Mon Sep 17 00:00:00 2001 From: Chris Deguzman Date: Thu, 8 Jan 2015 06:40:01 +0000 Subject: [PATCH] Adds ignore list for show titles. --- accidentalbot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/accidentalbot.js b/accidentalbot.js index fe450c3..1bda6f6 100644 --- a/accidentalbot.js +++ b/accidentalbot.js @@ -30,6 +30,7 @@ function saveBackup() { function handleNewSuggestion(from, message) { var title = ''; + var ignore_list = [/of siracusa county/i,]; if (message.match(/^!s(?:uggest)?\s+(.+)/)) { title = RegExp.$1.compact(); } @@ -39,6 +40,14 @@ function handleNewSuggestion(from, message) { ' characters); please try again.'); title = ''; } + + for(var idx in ignore_list) { + if(message.match(ignore_list[idx])) { + client.say(from, 'Please don\'t suggest that.'); + title = ''; + } + } + if (title.length > 0) { var normalizedTitle = normalize(title);