From 346971ee4091f545546585a5cd276bbb76258f18 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 24 Jun 2015 02:14:16 +0200 Subject: [PATCH] Rename group_list to chat_list for consistency --- scripts/telegram.coffee | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/telegram.coffee b/scripts/telegram.coffee index 25c0eca..6d1dee8 100644 --- a/scripts/telegram.coffee +++ b/scripts/telegram.coffee @@ -90,14 +90,6 @@ module.exports = (robot) -> return callback reply[1..] callback() - # return the list of active chat groups - group_list = (callback) -> - run_command 'dialog_list', (list) -> - chats = list.filter (item) -> not item.lastIndexOf 'Chat', 0 - chats = chats.map (chat) -> (chat.match /Chat (.+):/)[1] - robot.logger.info 'parsed bot chats list: ' + JSON.stringify chats, null, 2 - callback chats - robot.respond /chi sei/, (res) -> robot_info (user) -> username = if user.username? then " noto anche come #{user.username}" else '' @@ -114,7 +106,7 @@ module.exports = (robot) -> robot.respond /(in che gruppi sei| dove scrivi)/, (res) -> intro = ['scrivo in questi gruppi', 'chatto qui', 'sono attivo in'] - group_list (list) -> + chat_list (list) -> res.send (res.random intro) + ':\n' + (list.map (i) -> '* '+i).join '\n' robot.respond /(aggiungi(mi)?|crea) ((trai? (i )?contatti)|(il mio contatto))( (\d+))?/, (res) ->