diff --git a/robot-data/cache/account.secrets b/robot-data/cache/account.secrets index 2aa29c3..30e38cc 100644 Binary files a/robot-data/cache/account.secrets and b/robot-data/cache/account.secrets differ diff --git a/robot-data/cache/servers.json b/robot-data/cache/servers.json index 0745108..3111db3 100644 --- a/robot-data/cache/servers.json +++ b/robot-data/cache/servers.json @@ -1,42 +1,38 @@ [ { - "host": "111.30.182.254", + "host": "111.30.169.83", "port": 443 }, - { - "host": "36.155.187.225", - "port": 8080 - }, { "host": "msfwifi.3g.qq.com", "port": 8080 }, { - "host": "39.156.126.178", + "host": "111.30.182.254", "port": 443 }, { - "host": "39.156.140.102", + "host": "36.155.207.230", "port": 443 }, { - "host": "111.31.206.48", - "port": 80 - }, - { - "host": "36.155.205.230", + "host": "120.232.31.239", "port": 8080 }, { - "host": "36.155.245.16", - "port": 80 - }, - { - "host": "120.233.17.147", - "port": 8080 - }, - { - "host": "120.232.27.24", + "host": "120.241.130.195", "port": 14000 + }, + { + "host": "36.155.163.25", + "port": 80 + }, + { + "host": "39.156.126.178", + "port": 80 + }, + { + "host": "36.155.163.117", + "port": 8080 } ] \ No newline at end of file diff --git a/src/main/java/com/mtz/qqbot/Listener/RecallMessageListener.java b/src/main/java/com/mtz/qqbot/Listener/RecallMessageListener.java index 95a17fe..91a6548 100644 --- a/src/main/java/com/mtz/qqbot/Listener/RecallMessageListener.java +++ b/src/main/java/com/mtz/qqbot/Listener/RecallMessageListener.java @@ -25,28 +25,27 @@ public class RecallMessageListener extends MessageListener { super(List.of("原神", "OP"), true);//自定义违禁词 } - public void recall(GroupMessageEvent event) throws InterruptedException {//当有人发违禁词自动撤回并禁言一分钟 + public int recall(GroupMessageEvent event, int groupInvalidCount, Map groupMemberInvalidedCountList, List groupInvalidMember) throws InterruptedException {//当有人发违禁词自动撤回并禁言一分钟 String message = event.getMessage().contentToString(); if (this.invalidText(message)) { event.getSender().mute(60);//禁言60秒 Thread.sleep(500);//半秒后撤回方便演示 this.recallMessage(event.getMessage()); + groupInvalidCount++; + invalidMember.invalidCountList(groupMemberInvalidedCountList, event); + invalidMember.invalidMemberList(groupInvalidMember, groupMemberInvalidedCountList, event); + return groupInvalidCount; } + return groupInvalidCount; } @RobotListenerHandler(contactId = 518909220)//监控增加群聊1 public void recallGroup1Message(GroupMessageEvent event) throws InterruptedException { - recall(event); - group1InvalidCount++; - invalidMember.invalidCountList(group1MemberInvalidedCountList, event); - invalidMember.invalidMemberList(group1InvalidMember, group1MemberInvalidedCountList, event); + group1InvalidCount = recall(event, group1InvalidCount, group1MemberInvalidedCountList, group1InvalidMember); } @RobotListenerHandler(contactId = 1033597003)//监控增加群聊2 public void recallGroup2Message(GroupMessageEvent event) throws InterruptedException { - recall(event); - group2InvalidCount++; - invalidMember.invalidCountList(group2MemberInvalidedCountList, event); - invalidMember.invalidMemberList(group2InvalidMember, group2MemberInvalidedCountList, event); + group2InvalidCount = recall(event, group2InvalidCount, group2MemberInvalidedCountList, group2InvalidMember); } } diff --git a/src/main/java/com/mtz/qqbot/QqBotApplication.java b/src/main/java/com/mtz/qqbot/QqBotApplication.java index cc2d805..476095d 100644 --- a/src/main/java/com/mtz/qqbot/QqBotApplication.java +++ b/src/main/java/com/mtz/qqbot/QqBotApplication.java @@ -6,8 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class QqBotApplication { - public static void main(String[] args) { - SpringApplication.run(QqBotApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(QqBotApplication.class, args); + } }