新增图片支持File
调整涩图模块为先自己下载,无法下载再丢url给qq机器人 移除部分日志
This commit is contained in:
@@ -8,8 +8,10 @@ import com.yutou.napcat.model.*;
|
||||
import com.yutou.okhttp.HttpCallback;
|
||||
import com.yutou.napcat.http.NapCatApi;
|
||||
import com.yutou.qqbot.QQBotManager;
|
||||
import com.yutou.qqbot.utlis.Base64Tools;
|
||||
import lombok.val;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -30,8 +32,25 @@ public class NapCatQQ {
|
||||
list.add(new At(583819556L));
|
||||
list.add(new Text("5"));
|
||||
QQBotManager.getInstance().sendMessage(false, 891655174L, list);*/
|
||||
val at = new At();
|
||||
System.out.println("at = " + at);
|
||||
NapCatApi.setLog(false);
|
||||
File file = new File("C:\\Users\\58381\\Downloads\\0074TT8Yly1hp5mqidwqeg30g20f27wh.gif");
|
||||
NapCatApi.getMessageApi().sendPrivateMsg(
|
||||
MessageHandleBuild.create()
|
||||
.setQQNumber(583819556L)
|
||||
//.add(new Image(file))
|
||||
.add(new Text("abc"))
|
||||
.build()
|
||||
).enqueue(new HttpCallback<SendMessageResponse>() {
|
||||
@Override
|
||||
public void onResponse(int code, String status, SendMessageResponse response, String rawResponse) {
|
||||
System.out.println("code = " + code + ", status = " + status + ", response = " + response + ", rawResponse = " + rawResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 私聊
|
||||
|
||||
Reference in New Issue
Block a user