diff --git a/D:/go-cqhttp/data/images/72a2d53c3fec41e5be225bd3cb28d48b.jpg b/D:/go-cqhttp/data/images/72a2d53c3fec41e5be225bd3cb28d48b.jpg new file mode 100644 index 0000000..1a62fec Binary files /dev/null and b/D:/go-cqhttp/data/images/72a2d53c3fec41e5be225bd3cb28d48b.jpg differ diff --git a/D:/go-cqhttp/data/images/a436b8cef7294c06971ce0f6844d0d3f.jpg b/D:/go-cqhttp/data/images/a436b8cef7294c06971ce0f6844d0d3f.jpg new file mode 100644 index 0000000..1a62fec Binary files /dev/null and b/D:/go-cqhttp/data/images/a436b8cef7294c06971ce0f6844d0d3f.jpg differ diff --git a/D:/go-cqhttp/data/images/caff78b68e9845018cfd7e2369e96f71.jpg b/D:/go-cqhttp/data/images/caff78b68e9845018cfd7e2369e96f71.jpg new file mode 100644 index 0000000..1a62fec Binary files /dev/null and b/D:/go-cqhttp/data/images/caff78b68e9845018cfd7e2369e96f71.jpg differ diff --git a/src/main/java/com/badeling/msbot/serviceImpl/MsgServiceImpl.java b/src/main/java/com/badeling/msbot/serviceImpl/MsgServiceImpl.java index f0aebdc..e480321 100644 --- a/src/main/java/com/badeling/msbot/serviceImpl/MsgServiceImpl.java +++ b/src/main/java/com/badeling/msbot/serviceImpl/MsgServiceImpl.java @@ -776,6 +776,51 @@ private ReplyMsg handleNameMsg(ReceiveMsg receiveMsg) { replyMsg.setAt_sender(true); replyMsg.setAuto_escape(false); + //识图 + if(raw_message.contains(MsbotConst.botName+"识图")) { + //识图 + String[] result = mvpImageService.handImageMsg(receiveMsg); + raw_message = ""; + + //接受数据 + try { + @SuppressWarnings("unchecked") + Map backMessage = (Map) JSONObject.parse(result[0]); + @SuppressWarnings("unchecked") + List> list = (List>) backMessage.get("words_result"); + for(Map a : list) { + raw_message = raw_message + a.get("words")+"\r\n"; + } + } catch (Exception e) { + e.printStackTrace(); + return null; + } + replyMsg.setReply(raw_message); + return replyMsg; + } + + //高精度识图 + if(raw_message.contains(MsbotConst.botName+"高精度识图")){ + //识图 + String[] result = mvpImageService.handHigherImageMsg(receiveMsg); + //接受数据 + raw_message = "高精度识图结果:\r\n"; + try { + @SuppressWarnings("unchecked") + Map backMessage = (Map) JSONObject.parse(result[0]); + @SuppressWarnings("unchecked") + List> list = (List>) backMessage.get("words_result"); + for(Map a : list) { + raw_message = raw_message + a.get("words")+"\r\n"; + } + } catch (Exception e) { + e.printStackTrace(); + return null; + } + replyMsg.setReply(raw_message); + return replyMsg; + } + //翻译 if(raw_message.contains(MsbotConst.botName+"翻译")) { raw_message = raw_message.substring(raw_message.indexOf("翻译")+2); @@ -793,6 +838,19 @@ private ReplyMsg handleNameMsg(ReceiveMsg receiveMsg) { return null; } + //roll点 + if(raw_message.contains(MsbotConst.botName+"roll")){ + try { + Random r = new Random(); + int roll = r.nextInt(100)+1; + replyMsg.setReply("点数为:"+roll); + return replyMsg; + } catch (Exception e) { + replyMsg.setReply("出现了一个意料之外的错误"); + e.printStackTrace(); + return replyMsg; + } + } //布尔学习 if(raw_message.contains("学习")&&raw_message.contains("布尔问")&&raw_message.contains("答")) { if(receiveMsg.getUser_id().equalsIgnoreCase(MsbotConst.masterId)) {