From 85fbce9f4ffe3f57c8c4ca7ff42e7d483689e2b0 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Fri, 4 Nov 2022 10:25:17 +0800 Subject: [PATCH] add WoodenFish.java --- .../qqbot/models/Commands/WoodenFish.java | 34 +++++++++++++++++++ .../java/com/yutou/qqbot/models/Model.java | 4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java diff --git a/src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java b/src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java new file mode 100644 index 0000000..6a2d58a --- /dev/null +++ b/src/main/java/com/yutou/qqbot/models/Commands/WoodenFish.java @@ -0,0 +1,34 @@ +package com.yutou.qqbot.models.Commands; + +import com.yutou.qqbot.Annotations.UseModel; +import com.yutou.qqbot.QQBotManager; +import com.yutou.qqbot.models.Model; +import net.mamoe.mirai.event.events.MessageEvent; + +import static com.yutou.qqbot.models.Model.QQGroupCommands.QQ_WOODEN; + +@UseModel +public class WoodenFish extends Model { + @Override + public boolean isUserPublic() { + return false; + } + + @Override + public String[] getUsePowers() { + return new String[]{QQ_WOODEN}; + } + + @Override + public String getModelName() { + return "电子木鱼"; + } + + @Override + public void onMessage(Long qq, MessageEvent event, boolean isGroup) { + super.onMessage(qq, event, isGroup); + if("地狱笑话".equals(msg)){ + QQBotManager.getInstance().sendMessage(qq,"功德+1"); + } + } +} diff --git a/src/main/java/com/yutou/qqbot/models/Model.java b/src/main/java/com/yutou/qqbot/models/Model.java index 6a90381..07c24bf 100644 --- a/src/main/java/com/yutou/qqbot/models/Model.java +++ b/src/main/java/com/yutou/qqbot/models/Model.java @@ -38,9 +38,11 @@ public abstract class Model implements ModelInterface { public final static String BILI_LIVE_DANMU_SEND="!b站签到"; public final static String BILI_LIVE_DANMU_DEL="!b站签到删除"; + public final static String QQ_WOODEN="!电子木鱼"; + } - public static class QQFromCommands { + public static class QQFromCommands { public static final String TURNIP_PROPHET = "大头菜"; public static final String TSDM_PAY = "!tsdm"; public static final String BAIDU_DOWN = "!bd";