(水) 补一点代码闲聊

This commit is contained in:
A.C.Sukazyo Eyre 2022-03-17 01:31:56 +08:00
parent ce53e70dfa
commit 653ba4c0a8
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD

View File

@ -26,6 +26,9 @@ public class OnUserRandoms extends EventListener {
if (preProcess.length > 1) return false; if (preProcess.length > 1) return false;
final String query = preProcess[0]; final String query = preProcess[0];
// ----- START CODE BLOCK COMMENT -----
// 这里实现思路和代码优化有至少一半是 copilot IDEA 提供的
// 实现思路都可以从人类手里抢一半贡献太恐怖了aba
String result = null; String result = null;
final Matcher matcher; final Matcher matcher;
if (query.contains("还是")) { if (query.contains("还是")) {
@ -36,6 +39,7 @@ public class OnUserRandoms extends EventListener {
if (matcher.find()) { if (matcher.find()) {
result = ThreadLocalRandom.current().nextBoolean() ? matcher.group(1) : matcher.group(2); result = ThreadLocalRandom.current().nextBoolean() ? matcher.group(1) : matcher.group(2);
} }
// ----- STOP CODE BLOCK COMMENT -----
if (result == null) return false; if (result == null) return false;
MornyCoeur.extra().exec(new SendMessage( MornyCoeur.extra().exec(new SendMessage(