1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-08-01 16:38:02 +08:00

#887 enhance chatbot message display

Signed-off-by: Hai Liang Wang <hai@chatopera.com>
This commit is contained in:
Hai Liang Wang 2023-07-31 09:58:01 +08:00
parent 757229cb55
commit 89c67bed3c

View File

@ -128,7 +128,8 @@ public class ChatbotEventSubscription {
JSONObject data = (JSONObject) result.getData();
if (data.has("logic_is_fallback")) {
ChatMessage resp = creatChatMessage(request, c);
resp.setMessage(data.getString("string"));
String htmlMessage = data.getString("string").replaceAll("(\r\n|\n)", "<br />");
resp.setMessage(htmlMessage);
ChatMessage respHelp = new ChatMessage();
JSONArray respParams = new JSONArray();
if (!StringUtils.equals(MainContext.ChannelType.WEBIM.toString(), c.getChannel())) {