Remove unwanted whitespace in peer name

This commit is contained in:
rnhmjoj 2015-10-31 02:48:06 +01:00
parent 25aa5ff53d
commit 5cc234d037

View File

@ -54,7 +54,7 @@ module.exports = (robot) ->
regex = /\[(.+)\] (.+) [>«»]+ ((?:(?!\n(\[|\d))[\s\S])+)/g
parse_line = (x) ->
date: x[1]
peer: x[2].replace chat + ' ', ''
peer: x[2].replace(chat, '').trim()
text: x[3].trim().replace '\n', ' '
run_command "history #{chat} #{size}", (lines) ->
callback ((match_all regex, lines.join '\n').map parse_line)