Skip to content

Commit a0f6d57

Browse files
committed
新增: 摸头@hd
Signed-off-by: hd <hdshare@vip.qq.com>
1 parent 8d7c002 commit a0f6d57

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ features:
6666
details: 自定义好友或者群聊头像
6767
link: https://github.com/HdShare/WAuxiliary_Plugin/tree/main/plugins/hd/CustomAvatar
6868

69+
- title: 摸头@hd
70+
details: 命令[/rua]引用他人消息, 即可生成摸头GIF并发送
71+
link: https://github.com/HdShare/WAuxiliary_Plugin/tree/main/plugins/hd/Avatar-rua
72+
6973
- title: 文生图@CkBcDD
7074
details: 命令[/作图 Corn Hub], 长按发送按钮生成并发送图片
7175
link: https://github.com/HdShare/WAuxiliary_Plugin/tree/main/plugins/CkBcDD/TXT-to-IMG
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
import java.io.File;
3+
4+
import me.hd.wauxv.plugin.api.callback.PluginCallBack;
5+
6+
void onHandleMsg(Object msgInfoBean) {
7+
if (msgInfoBean.isSend() && msgInfoBean.isQuote()) {
8+
String talker = msgInfoBean.getTalker();
9+
String title = msgInfoBean.getQuoteMsg().getTitle();
10+
if (title.contains("/rua")) {
11+
String quoteMsgSendTalker = msgInfoBean.getQuoteMsg().getSendTalker();
12+
String avatarUrl = getAvatarUrl(quoteMsgSendTalker);
13+
if (!avatarUrl.equals("")) {
14+
download("https://api.52vmy.cn/api/avath/rua?url=" + avatarUrl, pluginDir + "/avatar.gif", null, new PluginCallBack.DownloadCallback() {
15+
public void onSuccess(File file) {
16+
sendEmoji(talker, file.getAbsolutePath());
17+
}
18+
19+
public void onError(Exception e) {
20+
sendText(talker, "[维梦API]生成异常:" + e.getMessage());
21+
}
22+
});
23+
} else {
24+
sendText(talker, "获取头像异常");
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)