From 4e56d31e4392eab441297125fd7cba4c4f169d50 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Sun, 17 Apr 2022 02:24:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yutou/qqbot/models/setu/GetSeTu.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java index 9dcd143..e5f05c7 100644 --- a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java +++ b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java @@ -47,14 +47,29 @@ public class GetSeTu extends Model { QQBotManager.getInstance().sendMessage(qq,"找不到喵~"); return; } - HttpTools.download(json.getJSONArray("data").getJSONObject(0).getJSONObject("urls").getString("original"), + JSONObject item=json.getJSONArray("data").getJSONObject(0); + StringBuilder builder=new StringBuilder(); + builder.append(item.getString("title")); + builder.append("\n"); + builder.append("R18:"); + if(item.getBoolean("r18")){ + builder.append("YES!"); + }else{ + builder.append("NO~"); + } + builder.append("\n"); + builder.append("tags:"); + for (Object tags : item.getJSONArray("tags")) { + builder.append(tags).append("、"); + } + HttpTools.download(item.getJSONObject("urls").getString("original"), System.currentTimeMillis()+"_setu.jpg", true , new DownloadInterface() { @Override public void onDownload(File file) { super.onDownload(file); - QQBotManager.getInstance().sendMessage(file, qq, ""); + QQBotManager.getInstance().sendMessage(file, qq, builder.toString()); } @Override