scala-slack-bot-core
scala-slack-bot-core copied to clipboard
`OutboundMessage` doesn't escape the newline in JSON
https://github.com/ScalaConsultants/scala-slack-bot-core/blob/master/src/main/scala/io/scalac/slack/common/Messages.scala#L52
If the text contains newline or ", it will break the JSON format.
Example:
val response = OutboundMessage(message.channel, s"""ha","escape":"bad""")
publish(response)
Expected Payload:
{
"id": 1,
"type": "message",
"channel": "D08GG2WJF",
"text": "ha\",\"escape\":\"bad"
}
Actual Payload:
{
"id": 1,
"type": "message",
"channel": "D08GG2WJF",
"text": "ha","escape":"bad"
}