diff --git a/src/main/java/com/mikuac/shiro/handler/EventHandler.java b/src/main/java/com/mikuac/shiro/handler/EventHandler.java index 973b958..5dcd8eb 100644 --- a/src/main/java/com/mikuac/shiro/handler/EventHandler.java +++ b/src/main/java/com/mikuac/shiro/handler/EventHandler.java @@ -38,7 +38,6 @@ public class EventHandler { InjectionHandler injectionHandler = new InjectionHandler(); - @Resource private ApplicationContext applicationContext; @@ -80,14 +79,11 @@ public void handler(Bot bot, @NotNull JSONObject eventJson) { */ private boolean setInterceptor(Bot bot, MessageEvent event) { try { - if (!getInterceptor(bot.getBotMessageEventInterceptor()).preHandle(bot, event)) { - return true; - } + return !getInterceptor(bot.getBotMessageEventInterceptor()).preHandle(bot, event); } catch (Exception e) { e.printStackTrace(); + return false; } - - return false; } /** diff --git a/src/main/java/com/mikuac/shiro/properties/PluginProperties.java b/src/main/java/com/mikuac/shiro/properties/PluginProperties.java index c1783d2..a872cd5 100644 --- a/src/main/java/com/mikuac/shiro/properties/PluginProperties.java +++ b/src/main/java/com/mikuac/shiro/properties/PluginProperties.java @@ -25,6 +25,9 @@ public class PluginProperties { */ List> pluginList = new ArrayList<>(); + /** + * 拦截器 + */ Class interceptor = DefaultBotMessageEventInterceptor.class; }