Rename group_list to chat_list for consistency

This commit is contained in:
rnhmjoj 2015-06-24 02:14:16 +02:00
parent e09bbf3c76
commit 346971ee40

View File

@ -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) ->