8000 [企业微信]机器人发送消息接口中增加发送语音类型消息 by Hugo-Ho · Pull Request #3179 · binarywang/WxJava · GitHub
[go: up one dir, main page]

Skip to content

[企业微信]机器人发送消息接口中增加发送语音类型消息 #3179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ public interface WxCpGroupRobotService {
*/
void sendFile(String webhookUrl, String mediaId) throws WxErrorException;

/**
* 发送文件类型的消息
*
* @param webhookUrl webhook地址
* @param mediaId 语音文件id
* @throws WxErrorException 异常
*/
void sendVoice(String webhookUrl, String mediaId) throws WxErrorException;

/**
* 发送模板卡片消息
* @param webhookUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ public void sendFile(String webhookUrl, String mediaId) throws WxErrorException
.setMediaId(mediaId).toJson());
}


@Override
public void sendVoice(String webhookUrl, String mediaId) throws WxErrorException {
this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage()
.setMsgType(GroupRobotMsgType.VOICE)
.setMediaId(mediaId).toJson());
}

@Override
public void sendTemplateCardMessage(String webhookUrl, WxCpGroupRobotMessage wxCpGroupRobotMessage) throws WxErrorException {
this.cpService.postWithoutToken(webhookUrl, wxCpGroupRobotMessage.toJson());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ public static class GroupRobotMsgType {
*/
public static final String FILE = "file";

/**
* 文件类型消息.
*/
public static final String VOICE = "voice";

/**
* 模版类型消息.
*/
Expand Down
0