From af3f85618df887e076d95aee1e1bf8e72d885910 Mon Sep 17 00:00:00 2001 From: yutou <583819556@qq.com> Date: Mon, 4 Sep 2023 12:19:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=A5=E9=81=A5=E9=A2=86=E5=85=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yutou/qqbot/models/Commands/WoodenFish.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java b/src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java index 8115891..d478a34 100644 --- a/src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java +++ b/src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java @@ -35,15 +35,20 @@ public class WoodenFish extends Model { @Override public void onMessage(Long qq, MessageEvent event, boolean isGroup) { super.onMessage(qq, event, isGroup); + File file = null; if(msg.contains("地狱笑话")){ - File file=new File("muyu.mp3"); + file=new File("muyu.mp3"); + QQBotManager.getInstance().sendMessage(qq,"功德+1"); + }else if(msg.contains("遥遥领先")){ + file=new File("遥遥领先.m4a"); + } + if(file!=null){ if(file.exists()) { OfflineAudio audio = Objects.requireNonNull(event.getBot().getGroup(qq)).uploadAudio(ExternalResource.create(file)); MessageChainBuilder builder = new MessageChainBuilder(); builder.append(audio); QQBotManager.getInstance().sendMessage(qq,builder); } - QQBotManager.getInstance().sendMessage(qq,"功德+1"); } } }