From 082112cc21bd2911d87c510a2cda4c659f099216 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 30 Jun 2015 04:31:51 +0200 Subject: [PATCH] Fix error when chat is unknown (damn precedence) --- scripts/telegram.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/telegram.coffee b/scripts/telegram.coffee index 012951b..0afd9da 100644 --- a/scripts/telegram.coffee +++ b/scripts/telegram.coffee @@ -132,7 +132,7 @@ module.exports = (robot) -> robot.respond /(mi )?invit(i|ami) (in|nel gruppo) ([^?]+)\??/, (res) -> denied = ['BZBZ ADMIN-NOT-DETECTED', 'BZBZ IS-NOT-AUTHORIZED', 'BZBZ ACCESS-DENIED'] - nope = ['ahahah NO', 'mai sentito questo?', 'invita anche me magari'] + nope = ['ahahah NO', 'mai sentito questo', 'invita anche me magari', 'che?'] ok = ['provvedo subito', 'ok', 'certo', 'va bene'] done = ['fatto', 'ecco qui', 'ecco fatto'] @@ -141,7 +141,7 @@ module.exports = (robot) -> admin_id = process.env['ADMIN_ROOM'].replace ':', '#' chat_list (list) -> - if not name in list + if not (name in list) return res.send res.random nope chat_info name, (chat) -> if chat.id is admin_id