From fc265f0a3782f32d0b0a7df19e45b342e2048efc Mon Sep 17 00:00:00 2001 From: Guimc Date: Sun, 7 Jul 2024 16:02:29 +0800 Subject: [PATCH] fix --- src/main/kotlin/ltd/guimc/plugin/quotly/QuotLyCommand.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/ltd/guimc/plugin/quotly/QuotLyCommand.kt b/src/main/kotlin/ltd/guimc/plugin/quotly/QuotLyCommand.kt index 2b30a26..76e3f7c 100644 --- a/src/main/kotlin/ltd/guimc/plugin/quotly/QuotLyCommand.kt +++ b/src/main/kotlin/ltd/guimc/plugin/quotly/QuotLyCommand.kt @@ -80,17 +80,13 @@ object QuotLyCommand: SimpleCommand( " \"photo\": {\n" + " \"url\": \"${member.avatarUrl}\"\n" + " }\n" + - " },\n" + - " \"text\": \"${textMessage.replace("\\", "\\\\") - .replace("\r", "\\r") - .replace("\n", "\\n") - .replace("\t", "\\t") - .replace("\"", "\\\"")}\",\n" + + " }\n" + " }\n" + " ]\n" + " }") cooldown.flag(user!!) + postValue.getJSONArray("messages").getJSONObject(0).put("text", textMessage) try { val rawResp = JSONObject(HttpUtil.post("http://127.0.0.1:3000/generate", postValue.toString())) val resp = rawResp.getJSONObject("result").getString("image")