Rename group_list to chat_list for consistency
This commit is contained in:
parent
e09bbf3c76
commit
346971ee40
@ -90,14 +90,6 @@ module.exports = (robot) ->
|
|||||||
return callback reply[1..]
|
return callback reply[1..]
|
||||||
callback()
|
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.respond /chi sei/, (res) ->
|
||||||
robot_info (user) ->
|
robot_info (user) ->
|
||||||
username = if user.username? then " noto anche come #{user.username}" else ''
|
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) ->
|
robot.respond /(in che gruppi sei| dove scrivi)/, (res) ->
|
||||||
intro = ['scrivo in questi gruppi', 'chatto qui', 'sono attivo in']
|
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'
|
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) ->
|
robot.respond /(aggiungi(mi)?|crea) ((trai? (i )?contatti)|(il mio contatto))( (\d+))?/, (res) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user