新增涩图

更新QQ机器人
This commit is contained in:
Yutousama 2022-01-02 00:40:09 +08:00
parent 75f3a68faf
commit 6a68e95f45
2 changed files with 5 additions and 6 deletions

View File

@ -35,7 +35,7 @@
<dependency>
<groupId>net.mamoe</groupId>
<artifactId>mirai-core-jvm</artifactId>
<version>2.7.1</version>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>

View File

@ -24,16 +24,15 @@ public class GetSeTu extends Model {
@Override
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
super.onMessage(qq, event, isGroup);
if ("来点色图".equals(msg)||"来点涩图".equals(msg)){
String ret=HttpTools.get("https://api.ixiaowai.cn/api/api.php?return=json");
JSONObject json=JSONObject.parseObject(ret);
if ("来点色图".equals(msg) || "来点涩图".equals(msg)) {
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,qq,"");
file.deleteOnExit();
QQBotManager.getInstance().sendMessage(file, qq, "");
}
});
}