From a2070059af423fe583564152193825b2f743afe8 Mon Sep 17 00:00:00 2001 From: yutou Date: Tue, 2 Feb 2021 14:09:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DQQ=E8=AF=84=E5=88=86=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E4=B8=8D=E8=83=BD=E5=A4=A7=E4=BA=8E3=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=87=8D=E5=90=8D=E5=AF=BC=E8=87=B4=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E8=A2=AB=E8=AE=A1=E7=AE=97=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yutou/tools/ToolsApplication.java | 2 +- src/main/java/com/yutou/tools/other/QQSetu.java | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/yutou/tools/ToolsApplication.java b/src/main/java/com/yutou/tools/ToolsApplication.java index 8b575ac..9ec7b18 100644 --- a/src/main/java/com/yutou/tools/ToolsApplication.java +++ b/src/main/java/com/yutou/tools/ToolsApplication.java @@ -9,7 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ToolsApplication { - public static final String version="1.0.16.11"; + public static final String version="1.0.16.12"; public static void main(String[] args) { System.out.println("当前版本号:"+version); diff --git a/src/main/java/com/yutou/tools/other/QQSetu.java b/src/main/java/com/yutou/tools/other/QQSetu.java index 9d94f4c..e0a8d0f 100644 --- a/src/main/java/com/yutou/tools/other/QQSetu.java +++ b/src/main/java/com/yutou/tools/other/QQSetu.java @@ -54,7 +54,7 @@ public class QQSetu { builder.append(Image.fromId(info.getString("id"))); builder.append("本日最佳涩图由").append(new At(info.getLong("sourQQ"))).append("提供\n"); builder.append("获得分数 ").append(String.valueOf(setu.getFloat("average"))).append("\n"); - builder.append("共有 ").append(String.valueOf(score.getIntValue("userNumber"))).append(" 参与投票"); + builder.append("共有 ").append(String.valueOf(score.getIntValue("userNumber"))).append(" 人参与投票"); QQBotManager.getInstance().sendMessage(info.getLong("group"),builder); } } @@ -129,11 +129,11 @@ public class QQSetu { average += setuScore.get(name); if (setuScore.get(name) > max) { max = setuScore.get(name); - maxName = name; + maxName = name.split("\\|")[0]; } if (setuScore.get(name) < min) { min = setuScore.get(name); - minName = name; + minName = name.split("\\|")[0]; } } JSONObject score = new JSONObject(); @@ -145,8 +145,8 @@ public class QQSetu { score.put("userNumber", setuScore.size()); average = average / setuScore.size(); - String builder = "涩图评分:" + average + - "其中最高分由:" + maxName + " 给与:" + max + + String builder = "涩图评分:" + average +"\n "+ + "其中最高分由:" + maxName + " 给与:" + max +"\n "+ "其中最低分由:" + minName + " 给与:" + min; QQBotManager.getInstance().sendMessage(group, builder); String st = RedisTools.get(Tools.getToDayTime() + "_setu", 1); @@ -182,11 +182,15 @@ public class QQSetu { } } try { + if(msg.trim().length()>2){ + return; + } float i = Float.parseFloat(msg.trim()); if (i > 0 && i <= 10) { String name = event.getSenderName(); + String qq=event.getSender().getId()+""; if (!setuScore.containsKey(name)) { - setuScore.put(name, i); + setuScore.put(name+"|"+qq, i); } } } catch (Exception ignored) {