Remove unwanted whitespace in peer name
This commit is contained in:
parent
25aa5ff53d
commit
5cc234d037
@ -54,7 +54,7 @@ module.exports = (robot) ->
|
|||||||
regex = /\[(.+)\] (.+) [>«»]+ ((?:(?!\n(\[|\d))[\s\S])+)/g
|
regex = /\[(.+)\] (.+) [>«»]+ ((?:(?!\n(\[|\d))[\s\S])+)/g
|
||||||
parse_line = (x) ->
|
parse_line = (x) ->
|
||||||
date: x[1]
|
date: x[1]
|
||||||
peer: x[2].replace chat + ' ', ''
|
peer: x[2].replace(chat, '').trim()
|
||||||
text: x[3].trim().replace '\n', ' '
|
text: x[3].trim().replace '\n', ' '
|
||||||
run_command "history #{chat} #{size}", (lines) ->
|
run_command "history #{chat} #{size}", (lines) ->
|
||||||
callback ((match_all regex, lines.join '\n').map parse_line)
|
callback ((match_all regex, lines.join '\n').map parse_line)
|
||||||
|
Loading…
Reference in New Issue
Block a user