修复QQ评分长度不能大于3
修复重名导致不会被计算的问题
This commit is contained in:
parent
6b42cf5ca4
commit
a2070059af
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user