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 233d281..e48441b 100644 --- a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java +++ b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java @@ -42,6 +42,10 @@ public class GetSeTu extends Model { } String ret = HttpTools.get(url); JSONObject json = JSONObject.parseObject(ret); + if(json.getJSONArray("data").size()==0){ + QQBotManager.getInstance().sendMessage(qq,"找不到喵~"); + return; + } HttpTools.download(json.getJSONArray("data").getJSONObject(0).getJSONObject("urls").getString("original"), System.currentTimeMillis()+"_setu.jpg", true @@ -55,7 +59,7 @@ public class GetSeTu extends Model { @Override public void onError(Exception e) { super.onError(e); - QQBotManager.getInstance().sendMessage(qq,"获取失败"); + QQBotManager.getInstance().sendMessage(qq,"获取失败喵~"); } }); }