Skip to content

Commit 1336918

Browse files
committed
fix QQEvent.java
1 parent 7af4949 commit 1336918

File tree

1 file changed

+10
-17
lines changed
  • plumbot-bukkit/src/main/java/me/regadpole/plumbot/event/qq

1 file changed

+10
-17
lines changed

plumbot-bukkit/src/main/java/me/regadpole/plumbot/event/qq/QQEvent.java

+10-17
Original file line numberDiff line numberDiff line change
@@ -238,23 +238,6 @@ public void onGroupMessageReceive(GroupMessage e){
238238
}
239239
return;
240240
}
241-
242-
pattern = Pattern.compile(Prefix+".*");
243-
matcher = pattern.matcher(msg);
244-
if(matcher.find()){
245-
if (!Config.SDC()){
246-
return;
247-
}
248-
String scmd = matcher.group().replace(Prefix+"", "");
249-
String gcmd = Config.getCommandsYaml().getString("Admin."+scmd);
250-
if(gcmd!=null) {
251-
PlumBot.getScheduler().runTaskAsynchronously(()->{
252-
String sendCqMsg = ServerManager.sendCmd(gcmd, true);
253-
bot.sendCQMsg(true, sendCqMsg, groupID);
254-
});
255-
return;
256-
}
257-
}
258241
}
259242

260243
if(msg.equals(Prefix+"帮助")) {
@@ -406,6 +389,16 @@ public void onGroupMessageReceive(GroupMessage e){
406389
return;
407390
}
408391
String scmd = matcher.group().replace(Prefix+"", "");
392+
if(Config.getAdmins().contains(senderID)) {
393+
String gcmd = Config.getCommandsYaml().getString("Admin." + scmd);
394+
if (gcmd != null) {
395+
PlumBot.getScheduler().runTaskAsynchronously(() -> {
396+
String sendCqMsg = ServerManager.sendCmd(gcmd, true);
397+
bot.sendCQMsg(true, sendCqMsg, groupID);
398+
});
399+
return;
400+
}
401+
}
409402
String gcmd = Config.getCommandsYaml().getString("User."+scmd);
410403
if(gcmd!=null) {
411404
PlumBot.getScheduler().runTaskAsynchronously(()->{

0 commit comments

Comments
 (0)