mirror of
https://gitee.com/hotlcc/wechat4j.git
synced 2025-06-27 20:52:45 +08:00
commit
5995be80ba
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.hotlcc</groupId>
|
||||
<artifactId>wechat4j</artifactId>
|
||||
<version>0.1.1</version>
|
||||
<version>0.1.2</version>
|
||||
|
||||
<name>wechat4j</name>
|
||||
<description>Wechat client for Java.</description>
|
||||
|
@ -1178,6 +1178,39 @@ public class Wechat {
|
||||
return sendText(content, userName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送文本消息(根据多种名称)
|
||||
*
|
||||
* @param content
|
||||
* @param userName
|
||||
* @param nickName
|
||||
* @param remarkName
|
||||
* @return
|
||||
*/
|
||||
public JSONObject sendText(String content, String userName, String nickName, String remarkName) {
|
||||
UserInfo userInfo = null;
|
||||
|
||||
if (StringUtil.isNotEmpty(userName)) {
|
||||
return sendText(content, userName);
|
||||
} else if (StringUtil.isNotEmpty(nickName)) {
|
||||
userInfo = getContactByNickName(false, nickName);
|
||||
} else if (StringUtil.isNotEmpty(remarkName)) {
|
||||
userInfo = getContactByRemarkName(false, remarkName);
|
||||
} else {
|
||||
String loginUserName = getLoginUserName(false);
|
||||
return sendText(content, loginUserName);
|
||||
}
|
||||
|
||||
if (userInfo == null) {
|
||||
return null;
|
||||
}
|
||||
userName = userInfo.getUserName();
|
||||
if (StringUtil.isEmpty(userName)) {
|
||||
return null;
|
||||
}
|
||||
return sendText(content, userName);
|
||||
}
|
||||
|
||||
//TODO 待完成
|
||||
@Deprecated
|
||||
public JSONObject sendImage(File image, String userName) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user