actions = ApricotCollectionFactor.linkedList();
11 |
12 | public static Affair of(Runnable action) {
13 | return new Affair().add(action);
14 | }
15 |
16 | public static Affair empty() {
17 | return new Affair();
18 | }
19 |
20 | public Affair add(Runnable action) {
21 | this.actions.add(action);
22 | return this;
23 | }
24 |
25 | public void done() {
26 | this.actions.forEach(Runnable::run);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/entrust/function/ExceptingFunction.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.entrust.function;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | @Stable
6 | @FunctionalInterface
7 | public interface ExceptingFunction {
8 | /**
9 | * Applies this function to the given argument.
10 | *
11 | * @param t the function argument
12 | * @return the function result
13 | */
14 | R apply(T t) throws Exception;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/entrust/function/ExceptingRunnable.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.entrust.function;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | import java.io.*;
6 |
7 | @Stable
8 | public interface ExceptingRunnable extends Serializable {
9 | void apply() throws Exception;
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/entrust/function/ExceptingSupplier.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.entrust.function;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | import java.io.*;
6 |
7 | /**
8 | * Represents a supplier of results.
9 | *
10 | * Ref from {@link java.util.function.Supplier}, throwing Exceptions
11 | *
12 | * There is no requirement that a new or distinct result be returned each
13 | * time the supplier is invoked.
14 | *
15 | *
This is a functional interface
16 | * whose functional method is {@link #get()}.
17 | *
18 | * @param the type of results supplied by this supplier
19 | */
20 | @Stable
21 | @FunctionalInterface
22 | public interface ExceptingSupplier extends Serializable {
23 |
24 | /**
25 | * Gets a result.
26 | *
27 | * @return a result
28 | */
29 | T get() throws Exception;
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/entrust/function/TriConsumer.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.entrust.function;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | import java.io.*;
6 | import java.util.*;
7 |
8 | @Stable
9 | public interface TriConsumer extends Serializable {
10 | /**
11 | * Returns a composed {@code Consumer} that performs, in sequence, this
12 | * operation followed by the {@code after} operation. If performing either
13 | * operation throws an exception, it is relayed to the caller of the
14 | * composed operation. If performing this operation throws an exception,
15 | * the {@code after} operation will not be performed.
16 | *
17 | * @param after
18 | * the operation to perform after this operation
19 | * @return a composed {@code Consumer} that performs in sequence this
20 | * operation followed by the {@code after} operation
21 | *
22 | */
23 | default TriConsumer andThen(TriConsumer after) {
24 | Objects.requireNonNull(after);
25 | return (x, y, z) -> {
26 | accept(x, y, z);
27 | after.accept(x, y, z);
28 | };
29 | }
30 |
31 | void accept(X x, Y y, Z z);
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/entrust/function/TriFunction.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.entrust.function;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | import java.util.*;
6 | import java.util.function.*;
7 |
8 | @Stable
9 | public interface TriFunction {
10 | /**
11 | * Applies this function to the given arguments.
12 | *
13 | * @param a the first function argument
14 | * @param b the second function argument
15 | * @return the function result
16 | */
17 | R apply(A a, B b, C c);
18 |
19 | /**
20 | * Returns a composed function that first applies this function to
21 | * its input, and then applies the {@code after} function to the result.
22 | * If evaluation of either function throws an exception, it is relayed to
23 | * the caller of the composed function.
24 | *
25 | * @param the type of output of the {@code after} function, and of the
26 | * composed function
27 | * @param after the function to apply after this function is applied
28 | * @return a composed function that first applies this function and then
29 | * applies the {@code after} function
30 | * @throws NullPointerException if after is null
31 | */
32 | default TriFunction andThen(Function super R, ? extends V> after) {
33 | Objects.requireNonNull(after);
34 | return (a, b, c) -> after.apply(apply(a, b, c));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/option/BiOption.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.option;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | /**
6 | * Choice one or two target.
7 | *
8 | * @param
9 | * Option type
10 | * @param first
11 | * First option
12 | * @param second
13 | * Second option
14 | * @author cao_awa
15 | * @since 1.0.0
16 | */
17 | @Stable
18 | public record BiOption(T first, T second) {
19 | public static BiOption of(X x1, X x2) {
20 | return new BiOption<>(
21 | x1,
22 | x2
23 | );
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/pair/Pair.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.pair;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | @Stable
6 | public record Pair(T left, Y right) {
7 | public static Pair of(T left, Y right) {
8 | return new Pair<>(
9 | left,
10 | right
11 | );
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/receptacle/Legacy.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.receptacle;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | @Stable
6 | public record Legacy(N newly, O stale) {
7 | }
8 |
--------------------------------------------------------------------------------
/src/main/java/com/github/zhuaidadaya/rikaishinikui/handler/universal/receptacle/Receptacle.java:
--------------------------------------------------------------------------------
1 | package com.github.zhuaidadaya.rikaishinikui.handler.universal.receptacle;
2 |
3 | import com.github.cao.awa.apricot.anntations.*;
4 |
5 | import java.util.function.*;
6 |
7 | @Stable
8 | public final class Receptacle {
9 | private T target;
10 |
11 | public Receptacle(T target) {
12 | this.target = target;
13 | }
14 |
15 | public static Receptacle of() {
16 | return of(null);
17 | }
18 |
19 | public static Receptacle of(X target) {
20 | return new Receptacle<>(target);
21 | }
22 |
23 | public T getOrSet(Supplier target) {
24 | if (this.target == null) {
25 | return set(target.get()).get();
26 | }
27 | return get();
28 | }
29 |
30 | public T get() {
31 | return this.target;
32 | }
33 |
34 | public Receptacle set(T target) {
35 | this.target = target;
36 | return this;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/resources/apricot.banner:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cao-awa/Apricot/45a46cd9fddf43387b9d84e4b4c7f978d7d2079a/src/main/resources/apricot.banner
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Apricot/Apricot.json:
--------------------------------------------------------------------------------
1 | {
2 | "blocked": [
3 | ]
4 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Captcha/Captcha.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows": [
3 | ],
4 | "licences": [
5 | ],
6 | "blocked": [
7 | ]
8 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Captcha/JoinGroup/JoinGroup.json:
--------------------------------------------------------------------------------
1 | {
2 | "mute": false,
3 | "allows": [
4 | ]
5 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Grass/FastDelete/FastDelete.json:
--------------------------------------------------------------------------------
1 | {
2 | "delete_responses": {
3 | "#": "#%s ",
4 | "unexpected_error": "执行命令时遇到了未知的错误",
5 | "missing_reason": "缺少快速删除理由",
6 | "fast_delete_must_reply_to_message": "使用快速删除时请回复要删除的消息",
7 | "deleted": "已尝试删除,",
8 | "unable_to_delete": "无法删除 #%s,请联系管理员或群主",
9 | "v": "理由为:恶意骚扰",
10 | "d6": "理由为:恶意骚扰",
11 | "d": "理由为:谣言信息",
12 | "d5": "理由为:谣言信息",
13 | "a": "理由为:人身攻击",
14 | "d4": "理由为:人身攻击",
15 | "s": "理由为:色情淫秽",
16 | "d3": "理由为:色情淫秽",
17 | "p": "理由为:政治敏感",
18 | "d2": "理由为:政治敏感",
19 | "ad": "理由为: 广告",
20 | "d1": "理由为: 广告",
21 | "n": "理由为: 其他",
22 | "d0": "理由为: 其他"
23 | }
24 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Grass/Grass.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows": [
3 | ],
4 | "licences": [
5 | ],
6 | "blocked": [
7 | ]
8 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Grass/MuteMe/MuteMe.json:
--------------------------------------------------------------------------------
1 | {
2 | "do_mute_me_response": "好",
3 | "cannot_mute_response": "不禁言你"
4 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Grass/QuickResponse/QuickResponse.json:
--------------------------------------------------------------------------------
1 | {
2 | "quick_responses": [
3 | "嗯嗯?",
4 | "怎么啦?",
5 | "有什么事?",
6 | "嗯?",
7 | "在",
8 | "怎么了?",
9 | "我不在"
10 | ]
11 | }
--------------------------------------------------------------------------------
/src/main/resources/assets/plugins/Lawn/Lawn.json:
--------------------------------------------------------------------------------
1 | {
2 | "allows": [
3 | ],
4 | "licences": [
5 | ],
6 | "blocked": [
7 | ]
8 | }
--------------------------------------------------------------------------------
/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------