修复QQ发图片会资源泄露的问题
This commit is contained in:
@@ -38,4 +38,22 @@ public class GetSeTu extends Model {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
QQBotManager.getInstance();
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String ret = HttpTools.get("https://api.ixiaowai.cn/api/api.php?return=json");
|
||||
JSONObject json = JSONObject.parseObject(ret);
|
||||
HttpTools.download(json.getString("imgurl"),
|
||||
"setu.jpg", new DownloadInterface() {
|
||||
@Override
|
||||
public void onDownload(File file) {
|
||||
super.onDownload(file);
|
||||
QQBotManager.getInstance().sendMessage(file, 583819556L, "");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user