From 8e68af82773c6face1d19287f1452494f4a402e4 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 23 Jun 2015 01:42:49 +0200 Subject: [PATCH] Add logging --- scripts/telegram.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/telegram.coffee b/scripts/telegram.coffee index 2b31881..1decc9f 100644 --- a/scripts/telegram.coffee +++ b/scripts/telegram.coffee @@ -82,6 +82,7 @@ module.exports = (robot) -> done = ['fatto', 'ecco qui', 'ecco'] group_list (list) -> chat = res.match[4] + user = res.message.user.name if not chat in list res.send res.random nope return @@ -89,5 +90,7 @@ module.exports = (robot) -> res.send res.random denied return res.send res.random ok - run_command "chat_add_user #{chat} #{res.message.user.name}" - res.send res.random done + run_command "chat_add_user #{chat} #{user}", (reply) -> + robot.logger.info "add user #{user} to chat #{chat}" + robot.logger.info 'result: ' + reply + res.send res.random done