Skip to content

Commit

Permalink
让bot变聪明(?
Browse files Browse the repository at this point in the history
  • Loading branch information
Dituon committed Jul 7, 2022
1 parent 05c7b02 commit 6c427a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/xmmt/dituon/plugin/Petpet.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void onEnable() {
try {
this.reloadPluginConfig(PetPetAutoSaveConfig.INSTANCE);
pluginPetService.readConfigByPluginAutoSave();
} catch (Exception ignored){
} catch (Exception ignored) {
getLogger().error("Mirai 2.11.0 提供了新的 JavaAutoSaveConfig 方法, 请更新Mirai版本至 2.11.0 (不是2.11.0-M1)\n使用旧版本将无法配置config");
}

Expand All @@ -62,7 +62,7 @@ private void onNudge(NudgeEvent e) {
pluginPetService.sendImage((Group) e.getSubject(), (Member) e.getFrom(), (Member) e.getTarget(), true);
} catch (Exception ex) { // 如果无法把被戳的对象转换为Member(只有Bot无法强制转换为Member对象)
try {
pluginPetService.sendImage((Group) e.getSubject(), (Member) e.getFrom(), ((Group) e.getSubject()).getBotAsMember(), true);
pluginPetService.sendImage((Group) e.getSubject(), ((Group) e.getSubject()).getBotAsMember(), (Member) e.getFrom(), true);
} catch (Exception ignored) { // 如果bot戳了别人
if (!pluginPetService.respondSelfNudge) return;
pluginPetService.sendImage((Group) e.getSubject(), ((Group) e.getSubject()).getBotAsMember(), (Member) e.getFrom(), true);
Expand Down

0 comments on commit 6c427a4

Please sign in to comment.