From fb75b5206ce472373b6f08aad1875d93378cfdc7 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Sat, 1 Jan 2022 23:36:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B6=A9=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yutou/qqbot/models/setu/GetSeTu.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java diff --git a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java new file mode 100644 index 0000000..79e0240 --- /dev/null +++ b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java @@ -0,0 +1,38 @@ +package com.yutou.qqbot.models.setu; + +import com.yutou.qqbot.QQBotManager; +import com.yutou.qqbot.interfaces.DownloadInterface; +import com.yutou.qqbot.models.Model; +import com.yutou.qqbot.utlis.HttpTools; +import net.mamoe.mirai.event.events.MessageEvent; +import net.mamoe.mirai.message.data.MessageChainBuilder; + +import java.io.File; + +public class GetSeTu extends Model { + @Override + public boolean isUserPublic() { + return true; + } + + @Override + public String[] getUsePowers() { + return new String[0]; + } + + @Override + public void onMessage(Long qq, MessageEvent event, boolean isGroup) { + super.onMessage(qq, event, isGroup); + if ("来点色图".equals(msg)||"来点涩图".equals(msg)){ + HttpTools.download(" https://api.ixiaowai.cn/api/api.php", + null, new DownloadInterface() { + @Override + public void onDownload(File file) { + super.onDownload(file); + QQBotManager.getInstance().sendMessage(file,qq,""); + file.deleteOnExit(); + } + }); + } + } +}