Skip to content

Commit

Permalink
🐛 Fixed interceptor invalid error
Browse files Browse the repository at this point in the history
  • Loading branch information
MisakaTAT committed Apr 4, 2022
1 parent 869b499 commit 21edb69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/java/com/mikuac/shiro/handler/EventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class EventHandler {

InjectionHandler injectionHandler = new InjectionHandler();


@Resource
private ApplicationContext applicationContext;

Expand Down Expand Up @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public class PluginProperties {
*/
List<Class<? extends BotPlugin>> pluginList = new ArrayList<>();

/**
* 拦截器
*/
Class<? extends BotMessageEventInterceptor> interceptor = DefaultBotMessageEventInterceptor.class;

}

0 comments on commit 21edb69

Please sign in to comment.