涩图模块:修复每日统计没效果

This commit is contained in:
Yutousama 2022-04-22 00:21:39 +08:00
parent 46322572c7
commit 05a892a135

View File

@ -42,7 +42,7 @@ public class GetSeTu extends Model {
super.onTime(qq, time);
if ("00:00:00".equals(time)) {
del();
} else if (RedisTools.get("Setu_time","23:59:00").equals(time)) {
} else if (RedisTools.get("Setu_time", "23:59:00").equals(time)) {
send();
}
}
@ -61,12 +61,15 @@ public class GetSeTu extends Model {
Jedis redis = RedisTools.getRedis();
redis.select(RedisTools.QQBOT_USER);
Set<String> keys = redis.keys("Setu_*");
Log.i("进入涩图打印:"+keys.size());
Log.i("进入涩图打印:" + keys.size());
redis.close();
for (String key : keys) {
if ("Setu_time".equals(key)) {
continue;
}
String ret = RedisTools.get(key);
MessageChainBuilder builder = null;
Log.i(key,ret);
Log.i(key, ret);
if (!StringUtils.isEmpty(ret)) {
JSONArray array = JSONArray.parseArray(key);
builder = new MessageChainBuilder();
@ -103,8 +106,8 @@ public class GetSeTu extends Model {
builder.append("如果炸群了请找他(\n");
builder.append("明天见~");
}
Log.i("打印色图统计:"+builder);
if (builder != null&& !"Setu_time".equals(key)) {
Log.i("打印色图统计:" + builder);
if (builder != null) {
QQBotManager.getInstance().sendMessage(Long.parseLong(key.replace("Setu_", "")), builder);
}
}