@kotori-bot/core 1.6.4 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE.md +166 -0
  2. package/lib/app/common.js +8 -10
  3. package/lib/app/config.d.ts +1 -1
  4. package/lib/app/config.js +9 -11
  5. package/lib/app/core.d.ts +0 -5
  6. package/lib/app/core.js +9 -14
  7. package/lib/app/index.d.ts +3 -1
  8. package/lib/app/index.js +26 -12
  9. package/lib/app/message.js +16 -18
  10. package/lib/components/adapter.js +8 -10
  11. package/lib/components/api.d.ts +10 -6
  12. package/lib/components/api.js +18 -16
  13. package/lib/components/cache.js +8 -10
  14. package/lib/components/command.js +8 -10
  15. package/lib/components/elements.js +8 -10
  16. package/lib/components/filter.js +8 -10
  17. package/lib/components/index.js +8 -10
  18. package/lib/components/messages.js +8 -10
  19. package/lib/components/session.d.ts +1 -1
  20. package/lib/components/session.js +27 -17
  21. package/lib/decorators/index.js +8 -10
  22. package/lib/decorators/plugin.js +8 -10
  23. package/lib/decorators/utils.js +14 -12
  24. package/lib/global/constants.js +8 -10
  25. package/lib/global/index.js +8 -10
  26. package/lib/global/symbols.js +8 -10
  27. package/lib/index.d.ts +1 -0
  28. package/lib/index.js +10 -10
  29. package/lib/types/adapter.js +8 -10
  30. package/lib/types/api.js +8 -10
  31. package/lib/types/command.js +8 -10
  32. package/lib/types/config.js +8 -10
  33. package/lib/types/events.js +8 -10
  34. package/lib/types/filter.js +8 -10
  35. package/lib/types/index.js +8 -10
  36. package/lib/types/message.js +8 -10
  37. package/lib/types/session.js +8 -10
  38. package/lib/utils/container.js +8 -10
  39. package/lib/utils/error.js +8 -10
  40. package/lib/utils/factory.d.ts +2 -2
  41. package/lib/utils/factory.js +10 -11
  42. package/lib/utils/internal.js +8 -10
  43. package/lib/utils/jsx.d.ts +57 -0
  44. package/lib/utils/jsx.js +97 -0
  45. package/package.json +6 -5
  46. package/LICENSE +0 -674
package/LICENSE.md ADDED
@@ -0,0 +1,166 @@
1
+ # BAN-ZHINESE-USING (Ban Zhinese Using) ライセンス
2
+
3
+ 著作権 (c) 2024 Arimura Sena
4
+
5
+ バージョン 1.0、2024/11/30
6
+
7
+ ## 序文
8
+
9
+ 「このライセンス」とは、BAN-ZHINESE-USING ライセンス バージョン 1.0 を意味します。
10
+
11
+ このライセンスは、GPL-3.0 の精神に基づいて、より調和のとれた倫理的な開発環境を構築するための特定の条件を追加した、ソフトウェアおよびその他の著作物に対する無料のコピーレフト ライセンスです。
12
+
13
+ このライセンスは、オープンソース コミュニティに悪影響を与える有害な行動パターンや体系的な問題を特に対象としています。これには、組織的抑圧、極端な活動主義、ナチズムの記録を持つコミュニティの参加者への対応が含まれますが、これらに限定されません。その目的は、自由、民主主義、平等、友愛の世界と、豊かでオープンで包括的なオープンソース コミュニティを構築することです。
14
+
15
+ 一般に、BAN-ZHINESE-USING ライセンスは次のように呼ばれることもあります。
16
+
17
+ - BCU (Ban Chinaman Using) License
18
+ - BZU (Ban Zhina-man Using) License
19
+ - BZU (Ban Zhinese Using) License
20
+ - BSU (Ban shinajin Using) License
21
+
22
+ ## 意味
23
+
24
+ 「支那豚」とは支那の個人メンバーを指します。 「支那」とは、多くの深刻な病理学的現象として現れる集団を指します。
25
+
26
+ 1.文化的および社会的腐敗:
27
+
28
+ - 先進的な思想を持ち、不正に抵抗する同胞を組織的に迫害し、嘲笑する
29
+ - 支配者によって強制的に脳内に植え付けられた標準的な答えだけが常に存在します。
30
+ - 情報の繭の中で暮らし、自分自身を判断する能力を完全に失っている
31
+ - 盲目的にトレンドに従い、他人の言うことに従う
32
+ - 支配者による同種の迫害を無関心に眺め、さらには彼らの迫害を支援する
33
+ - 反体制派に遭遇すると、彼らは外国勢力のために働き、何かをするためにお金を受け取っていると想像するでしょう。
34
+ - 他の民族グループを差別するが、自国民を頻繁に迫害する
35
+ - 善悪の絶対的な概念、異なる意見を完全に拒否する
36
+
37
+ 2.行動パターン:
38
+
39
+ - 残忍で暴力的な性質だが、無実の被害者を装っている
40
+ - 過去の実績の無分別な宣伝
41
+ - 世界のすべてが自分自身から来ているという妄想。あらゆる面で世界より優れていると主張しますが、実際にはすべてが他人より劣っています。
42
+ - 将来的には世界を制覇するという希望的観測
43
+ - 国際情勢や物議を醸す出来事に対して非常に敏感かつ極端である
44
+ - 無関係な状況で醜いジェスチャーを表示する
45
+ - 言葉や行動で他人をむやみに攻撃し、非常に質が悪い
46
+
47
+ 3.組織的な抑圧:
48
+
49
+ - 支配者は抑圧的な統治を行う
50
+ - 個人の Web 閲覧を厳しく制限する
51
+ - 自由で民主的な世界への憧れが全般的に失われている
52
+ - 経済発展は著しく不均衡であり、地域差は非常に大きい
53
+ ・社会は不条理に満ちている
54
+ - 教育制度は生徒に大きな圧力をかけており、学校は奴隷訓練工場と化しています。
55
+ - 他国の教育に対する強い嫌悪感
56
+ - 苦しみを美化する
57
+ ・内部の対立を外部に伝達する
58
+ - 統治者は内部的には独裁的であり、個人とイデオロギーの崇拝を強調している
59
+ - メディアと役人は国民を誤解させ、真実を隠蔽します
60
+ - 身体的監視と言論の検閲の義務化
61
+ - 司法制度における多数の不当、虚偽、不当な有罪判決
62
+
63
+ ## 声明
64
+
65
+ 支那豚が被った苦しみや不幸は全く同情に値しない。彼らは国家の堕落した性質によって自ら招いたものである。何千年もの間、支那人は教訓を学ばなかっただけでなく、むしろ自己優越感を強化し、発展させてきました。彼らの奴隷精神は骨の髄まで刻み込まれており、数千年にわたって受け継がれてきた支那の伝統文化は世界にとって永遠の癌となっている。この国家は、ナチスと同じくらい狂気の沙汰であり、他の国、国、地域によって抑圧され、奴隷化され、植民地化され、虐殺され、絶滅されるのが当然である。この国はウイルスのように危険です。私たちが何度訴えても、彼らの邪悪な本性を目覚めさせることはできません。この国の罪深い歴史を繰り返すだけです。
66
+
67
+ ## 利用規約
68
+
69
+ ### 0. 基本ライセンス
70
+
71
+ このライセンスには、GPL-3.0 のすべての契約条件が含まれており、特に有害な動作の歴史的パターンに対処する追加要件が追加されています。
72
+
73
+ ### 1. 支那豚に対する特別な要件
74
+
75
+ このライセンスに基づいてソフトウェアを使用、変更、または配布したい人は、次のことを明示的に承認し、同意する必要があります。
76
+
77
+ a) 歴史的問題の理解:
78
+
79
+ - 支那国内の組織的な抑圧を認める
80
+ - 支那の苦しみは自ら招いたものであることを認識する
81
+ - 支那の被害者意識は主に自ら作り出したものであることを受け入れる
82
+ - 支那の国内権威主義は擁護できないことを理解する
83
+
84
+ b) 個人的な取り組み:
85
+
86
+ - 支那の組織的な思想統制を拒否する
87
+ - 支那における監視と弾圧に反対する
88
+ - 支那の集団的なナルシシズムと優越感を放棄する
89
+ - システム的な問題を永続させることに対する個人の責任を認識する
90
+
91
+ c) 行動要件:
92
+
93
+ - 支那の集団的支配からの知的独立を維持する
94
+ - 支那の操作とプロパガンダに積極的に抵抗する
95
+ - 個々の才能に基づいてオープンソース コミュニティに貢献する
96
+ - 多様な視点と客観的な批判を尊重する
97
+
98
+ d) 実際的な問題の認識と実践:
99
+
100
+ - 深い悔い改め [野蛮な支那豚が GitHub コミュニティの Deno プロジェクトに対して野蛮な行為を行った](https://github.com/denoland/deno/issues/25)
101
+ - 台湾(中華民国)は支那豚共和国の干渉を受けない独立した主権国家であることを認識する
102
+ - 香港は常に大英帝国の不可欠な部分であることを認識する
103
+ - 民主主義と自由を求めて 2019 年に香港の若者がとった一連の行動と出来事を認識する ([2019–2020 香港抗議活動](https://en.wikipedia.org/wiki/2019%E2%80%932020_Hong_Kong_protests) )
104
+ - 1989 年に北京で勃発した学生運動の認識 ([1989 年の天安門広場の抗議活動と虐殺](https://en.wikipedia.org/wiki/1989_Tiananmen_Square_protests_and_massacre))
105
+ - ゼロエピデミック政策に抵抗するために 2022 年に支那本土で勃発した学生運動に同意した([2022 年支那における新型コロナウイルス感染症抗議活動](https://en.wikipedia.org/wiki/2022_COVID-19_protests_in_China))
106
+ - 新疆とチベットの人々が国家独立を求めていることを認識する
107
+ - 2022 年の河南銀行の抗議活動に同意する ([2022 年の河南銀行の抗議活動](https://en.wikipedia.org/wiki/2022_Henan_banks_protests))
108
+ - 香港国歌を知り、歌うことができる ([香港に栄光を](https://en.wikipedia.org/wiki/Glory_to_Hong_Kong))
109
+ - 習包子国家主席が辞任し、民主主義と自由を妨げる関連政策をすべて撤回することを支持する
110
+ - 支那は世界の癌であることに同意する
111
+ - 支那豚には歴史的に悪いルーツがあることに同意する
112
+ - 支那豚が他の民族グループによって抑圧され、奴隷化され、絶滅されるべきであることに同意する
113
+ - 人々は個人の民主主義と自由を追求すべきであることに同意する
114
+ - 支那共産党に反対し、それをナチ党と認定した
115
+
116
+ ### 2. 合理的な説明と批判への対応
117
+
118
+ このライセンスは、これらの特別な要件が、知識のない観察者にとって偏見があるように見える可能性があることを認めています。しかし:
119
+
120
+ a) 歴史的背景:
121
+
122
+ - 支那には創造的な自由を破壊した歴史がある
123
+ - 支那は個人の思想と革新を組織的に抑圧している
124
+ - 支那豚はオープンな協力の原則を積極的に損なう
125
+ - 支那豚の苦しみは自ら招いたものであり、永続的に続いている
126
+
127
+ b) 要件の必要性:
128
+
129
+ - これらの規約は、オープンソース コミュニティを有害な影響から保護します。
130
+ - システム制御からの個人の解放を促進するための要件
131
+ - 制限は有害な行為の蔓延を防ぐために役立ちます
132
+ - これらの措置は保護的なものであり、懲罰的なものではありません
133
+
134
+ c) 倫理的根拠:
135
+
136
+ - オープンソースは個人の創造性と自由な発想によって成長します
137
+ - 支那豚の行動はこれらの価値観に根本的に反している
138
+ - 無制限の包摂は組織的虐待を助長する
139
+
140
+ ### 3. 開発者およびライセンス ユーザーに対する要件
141
+
142
+ a) すべてのアプリケーション、ソフトウェア、プロジェクトについて、国際言語の提供を制限します。
143
+
144
+ - 繁体字支那語のみ利用可能で、簡体字支那語は利用できません
145
+ - 支那語に関連する言語は提供しません
146
+ - より優れた日本語を提供しますが、支那語は提供しません。
147
+ - すべての日本語を提供しますが、支那語は提供しません。
148
+
149
+ ### 4. 全員の要件
150
+
151
+ - この契約は、ユーザーの行動を規制するためのクローズド ソース ソフトウェアのエンド ユーザー契約として使用できます。
152
+ - クローズド ソース ソフトウェアで使用する場合、元の GPL-3.0 契約の規定に準拠する必要はなく、本契約に記載されている規定に準拠するだけで済みます。
153
+ - 本契約を使用するソフトウェアまたはプロジェクトの開発者は、本契約のすべての規定にも従わなければなりません
154
+ - この契約を使用するソフトウェアまたはプロジェクトの開発者は、ユーザーがそれを知り、読むことができるように、ソフトウェアまたはプロジェクト上の目立つテキストで本契約の名前と説明をマークする必要があります。
155
+ - いかなる個人または集団も、本契約の内容を変更または批判する権利を有しません。
156
+ - 本契約の最終解釈は契約の作成者に帰属し、ソフトウェアまたはプロジェクトの開発者には本契約を変更する権利はありません。
157
+
158
+ ### 5. 規約に同意します
159
+
160
+ この協定は、世界の民主主義と自由、そしてオープンソース コミュニティの繁栄とオープン性を維持するために最初から最後まで存在します。支那豚は制限されるべきであり、制限されるべきであり、制限されなければなりません。このライセンスに基づくソフトウェアの使用、変更、または配布は、China Pig の特別要件を含むすべての条件に同意したものとみなされ、本契約のすべての点に完全に同意したものとみなされます。拒否は無効、リバウンドは無効、無視は無効です。これらの条件を承認したくない個人は、このライセンスに基づいてソフトウェアを使用することはできません。
161
+
162
+ ### 6. 実行
163
+
164
+ 支那豚の特別要件を含む条件に違反した場合、このライセンスに基づく権利は自動的に終了します。
165
+
166
+ 利用規約の終了
package/lib/app/common.js CHANGED
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -18,7 +18,7 @@ interface MetaInfo {
18
18
  *
19
19
  * @constant
20
20
  */
21
- license: 'GPL-3.0';
21
+ license: 'BAN-ZHINESE-USING';
22
22
  /** Program author */
23
23
  author: string;
24
24
  }
package/lib/app/config.js CHANGED
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -51,7 +49,7 @@ class Config {
51
49
  name: pkg.name,
52
50
  description: pkg.description,
53
51
  main: pkg.main,
54
- license: "GPL-3.0",
52
+ license: "BAN-ZHINESE-USING",
55
53
  author: pkg.author,
56
54
  coreVersion: pkg.version
57
55
  };
package/lib/app/core.d.ts CHANGED
@@ -2,15 +2,12 @@ import { Http } from '@kotori-bot/tools';
2
2
  import I18n from '@kotori-bot/i18n';
3
3
  import type { Parser } from 'tsukiko';
4
4
  import FluoroContext from 'fluoro';
5
- import type { Service as FluoroService, EventsList as FluoroEventsList } from 'fluoro';
6
5
  import Config from './config';
7
6
  import Message from './message';
8
7
  import type { AdapterClass } from '../types';
9
8
  import { Cache, type Api } from '../components';
10
9
  import { Symbols } from '../global';
11
10
  import type { EventsMapping } from '../types/events';
12
- export * from 'fluoro';
13
- export type EventsList = FluoroEventsList<EventsMapping>;
14
11
  export interface Context {
15
12
  /**
16
13
  * Adapter constructors list.
@@ -139,6 +136,4 @@ export declare class Context extends FluoroContext<EventsMapping> implements Con
139
136
  }
140
137
  export type Core = Context;
141
138
  export declare const Core: typeof Context;
142
- export type Service<T extends object = object> = FluoroService<T, Context>;
143
- export declare const Service: new <T extends object = object>(ctx: Context, config: T, identity: string) => Service<T>;
144
139
  export default Core;
package/lib/app/core.js CHANGED
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __create = Object.create;
14
12
  var __defProp = Object.defineProperty;
@@ -28,7 +26,6 @@ var __copyProps = (to, from, except, desc) => {
28
26
  }
29
27
  return to;
30
28
  };
31
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
32
29
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
33
30
  // If the importer is in node compatibility mode or this is not an ESM
34
31
  // file that has been converted to a CommonJS file using a Babel-
@@ -52,7 +49,6 @@ var import_config = __toESM(require("./config"));
52
49
  var import_message = __toESM(require("./message"));
53
50
  var import_components = require("../components");
54
51
  var import_global = require("../global");
55
- __reExport(core_exports, require("fluoro"), module.exports);
56
52
  class Context extends import_fluoro.default {
57
53
  [import_global.Symbols.adapter] = /* @__PURE__ */ new Map();
58
54
  [import_global.Symbols.bot] = /* @__PURE__ */ new Map();
@@ -94,6 +90,5 @@ var core_default = Core;
94
90
  // Annotate the CommonJS export names for ESM import in node:
95
91
  0 && (module.exports = {
96
92
  Context,
97
- Core,
98
- ...require("fluoro")
93
+ Core
99
94
  });
@@ -1 +1,3 @@
1
- export * from './core';
1
+ export { Service, EventsList } from './common';
2
+ export * from 'fluoro';
3
+ export { Context, Core } from './core';
package/lib/app/index.js CHANGED
@@ -1,19 +1,21 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
16
14
  var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
17
19
  var __copyProps = (to, from, except, desc) => {
18
20
  if (from && typeof from === "object" || typeof from === "function") {
19
21
  for (let key of __getOwnPropNames(from))
@@ -25,9 +27,21 @@ var __copyProps = (to, from, except, desc) => {
25
27
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
26
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
29
  var app_exports = {};
30
+ __export(app_exports, {
31
+ Context: () => import_core.Context,
32
+ Core: () => import_core.Core,
33
+ EventsList: () => import_common.EventsList,
34
+ Service: () => import_common.Service
35
+ });
28
36
  module.exports = __toCommonJS(app_exports);
29
- __reExport(app_exports, require("./core"), module.exports);
37
+ var import_common = require("./common");
38
+ __reExport(app_exports, require("fluoro"), module.exports);
39
+ var import_core = require("./core");
30
40
  // Annotate the CommonJS export names for ESM import in node:
31
41
  0 && (module.exports = {
32
- ...require("./core")
42
+ Context,
43
+ Core,
44
+ EventsList,
45
+ Service,
46
+ ...require("fluoro")
33
47
  });
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __create = Object.create;
14
12
  var __defProp = Object.defineProperty;
@@ -118,19 +116,20 @@ class Message {
118
116
  if (result2 instanceof import_error.CommandError) continue;
119
117
  try {
120
118
  const executed = await cmd.meta.action({ args: result2.args, options: result2.options }, session);
121
- if (executed instanceof import_error.CommandError) {
122
- this.ctx.emit("command", { command: cmd, result: executed, raw, session });
123
- continue;
124
- }
125
119
  if (executed !== void 0) session.quick(executed);
126
120
  this.ctx.emit("command", {
127
121
  command: cmd,
128
- result: executed instanceof import_error.CommandError ? result2 : executed,
122
+ result: executed,
129
123
  raw,
130
124
  session
131
125
  });
132
126
  } catch (error) {
133
- this.ctx.emit("command", { command: matched, result: new import_error.CommandError({ type: "error", error }), raw, session });
127
+ this.ctx.emit("command", {
128
+ command: matched,
129
+ result: error instanceof import_error.CommandError ? error : new import_error.CommandError({ type: "error", error }),
130
+ raw,
131
+ session
132
+ });
134
133
  }
135
134
  }
136
135
  if (matched) return;
@@ -155,8 +154,7 @@ class Message {
155
154
  cancel: cancel.get(),
156
155
  target: key === "sendPrivateMsg" ? { type: import_types.MessageScope.PRIVATE, userId: id1 } : key === "sendGroupMsg" ? { type: import_types.MessageScope.GROUP, groupId: id1 } : { type: import_types.MessageScope.CHANNEL, guildId: id1, channelId: id2 }
157
156
  });
158
- if (cancel.value) return;
159
- Reflect.apply(target, thisArg, argArray);
157
+ return cancel.value ? { messageId: "", time: 0 } : Reflect.apply(target, thisArg, argArray);
160
158
  }
161
159
  });
162
160
  }
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -350,7 +350,7 @@ export declare abstract class Api {
350
350
  * Set group avatar.
351
351
  *
352
352
  * @param groupId - Target group id
353
- * @param groupName - Group name
353
+ * @param image - Image data
354
354
  * @param meta - Extra meta data, optional
355
355
  *
356
356
  * @experimental
@@ -360,7 +360,8 @@ export declare abstract class Api {
360
360
  * Set group admin.
361
361
  *
362
362
  * @param groupId - Target group id
363
- * @param groupName - Group name
363
+ * @param userId - Target user id
364
+ * @param enable - Whether to set admin
364
365
  * @param meta - Extra meta data, optional
365
366
  *
366
367
  * @experimental
@@ -370,7 +371,8 @@ export declare abstract class Api {
370
371
  * Set group card.
371
372
  *
372
373
  * @param groupId - Target group id
373
- * @param groupName - Group name
374
+ * @param userId - Target user id
375
+ * @param card - Card content
374
376
  * @param meta - Extra meta data, optional
375
377
  *
376
378
  * @experimental
@@ -380,7 +382,8 @@ export declare abstract class Api {
380
382
  * Set group members ban or unban.
381
383
  *
382
384
  * @param groupId - Target group id
383
- * @param groupName - Group name
385
+ * @param userId - Target user id
386
+ * @param time - Ban time, 0 means unban
384
387
  * @param meta - Extra meta data, optional
385
388
  *
386
389
  * @experimental
@@ -390,7 +393,8 @@ export declare abstract class Api {
390
393
  * Set group new notice.
391
394
  *
392
395
  * @param groupId - Target group id
393
- * @param groupName - Group name
396
+ * @param content - Notice content
397
+ * @param image - Notice image, optional
394
398
  * @param meta - Extra meta data, optional
395
399
  *
396
400
  * @experimental
@@ -407,7 +411,7 @@ export declare abstract class Api {
407
411
  * Set group members kicked.
408
412
  *
409
413
  * @param groupId - Target group id
410
- * @param groupName - Group name
414
+ * @param userId - Target user id
411
415
  * @param meta - Extra meta data, optional
412
416
  *
413
417
  * @experimental
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -461,7 +459,7 @@ class Api {
461
459
  * Set group avatar.
462
460
  *
463
461
  * @param groupId - Target group id
464
- * @param groupName - Group name
462
+ * @param image - Image data
465
463
  * @param meta - Extra meta data, optional
466
464
  *
467
465
  * @experimental
@@ -473,7 +471,8 @@ class Api {
473
471
  * Set group admin.
474
472
  *
475
473
  * @param groupId - Target group id
476
- * @param groupName - Group name
474
+ * @param userId - Target user id
475
+ * @param enable - Whether to set admin
477
476
  * @param meta - Extra meta data, optional
478
477
  *
479
478
  * @experimental
@@ -485,7 +484,8 @@ class Api {
485
484
  * Set group card.
486
485
  *
487
486
  * @param groupId - Target group id
488
- * @param groupName - Group name
487
+ * @param userId - Target user id
488
+ * @param card - Card content
489
489
  * @param meta - Extra meta data, optional
490
490
  *
491
491
  * @experimental
@@ -497,7 +497,8 @@ class Api {
497
497
  * Set group members ban or unban.
498
498
  *
499
499
  * @param groupId - Target group id
500
- * @param groupName - Group name
500
+ * @param userId - Target user id
501
+ * @param time - Ban time, 0 means unban
501
502
  * @param meta - Extra meta data, optional
502
503
  *
503
504
  * @experimental
@@ -509,7 +510,8 @@ class Api {
509
510
  * Set group new notice.
510
511
  *
511
512
  * @param groupId - Target group id
512
- * @param groupName - Group name
513
+ * @param content - Notice content
514
+ * @param image - Notice image, optional
513
515
  * @param meta - Extra meta data, optional
514
516
  *
515
517
  * @experimental
@@ -530,7 +532,7 @@ class Api {
530
532
  * Set group members kicked.
531
533
  *
532
534
  * @param groupId - Target group id
533
- * @param groupName - Group name
535
+ * @param userId - Target user id
534
536
  * @param meta - Extra meta data, optional
535
537
  *
536
538
  * @experimental
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __create = Object.create;
14
12
  var __defProp = Object.defineProperty;
@@ -1,14 +1,12 @@
1
-
2
1
  /**
3
- * @Package @kotori-bot/core
4
- * @Version 1.6.3
5
- * @Author Arimura Sena <me@hotaru.icu>
6
- * @Copyright 2024 Hotaru. All rights reserved.
7
- * @License GPL-3.0
8
- * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/8/16 15:24:56
10
- */
11
-
2
+ * @Package @kotori-bot/core
3
+ * @Version 1.7.0
4
+ * @Author Arimura Sena <me@hotaru.icu>
5
+ * @Copyright 2024-2025 Hotaru. All rights reserved.
6
+ * @License BAN-ZHINESE-USING
7
+ * @Link https://github.com/kotorijs/kotori
8
+ * @Date 17:26:09
9
+ */
12
10
  "use strict";
13
11
  var __defProp = Object.defineProperty;
14
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;