新增涩图
更新QQ机器人
This commit is contained in:
parent
75f3a68faf
commit
6a68e95f45
2
pom.xml
2
pom.xml
@ -35,7 +35,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.mamoe</groupId>
|
<groupId>net.mamoe</groupId>
|
||||||
<artifactId>mirai-core-jvm</artifactId>
|
<artifactId>mirai-core-jvm</artifactId>
|
||||||
<version>2.7.1</version>
|
<version>2.9.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jetbrains.kotlinx</groupId>
|
<groupId>org.jetbrains.kotlinx</groupId>
|
||||||
|
@ -24,16 +24,15 @@ public class GetSeTu extends Model {
|
|||||||
@Override
|
@Override
|
||||||
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
|
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
|
||||||
super.onMessage(qq, event, isGroup);
|
super.onMessage(qq, event, isGroup);
|
||||||
if ("来点色图".equals(msg)||"来点涩图".equals(msg)){
|
if ("来点色图".equals(msg) || "来点涩图".equals(msg)) {
|
||||||
String ret=HttpTools.get("https://api.ixiaowai.cn/api/api.php?return=json");
|
String ret = HttpTools.get("https://api.ixiaowai.cn/api/api.php?return=json");
|
||||||
JSONObject json=JSONObject.parseObject(ret);
|
JSONObject json = JSONObject.parseObject(ret);
|
||||||
HttpTools.download(json.getString("imgurl"),
|
HttpTools.download(json.getString("imgurl"),
|
||||||
"setu.jpg", new DownloadInterface() {
|
"setu.jpg", new DownloadInterface() {
|
||||||
@Override
|
@Override
|
||||||
public void onDownload(File file) {
|
public void onDownload(File file) {
|
||||||
super.onDownload(file);
|
super.onDownload(file);
|
||||||
QQBotManager.getInstance().sendMessage(file,qq,"");
|
QQBotManager.getInstance().sendMessage(file, qq, "");
|
||||||
file.deleteOnExit();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user