@kotori-bot/kotori-plugin-core 1.2.1 → 1.3.1

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.
package/lib/index.js CHANGED
@@ -1,70 +1,223 @@
1
- "use strict";
2
- /*
3
- * @Author: hotaru biyuehuya@gmail.com
4
- * @Blog: https://hotaru.icu
5
- * @Date: 2023-07-11 14:18:27
6
- * @LastEditors: Hotaru biyuehuya@gmail.com
7
- * @LastEditTime: 2024-02-09 21:33:48
1
+
2
+ /**
3
+ * @Package @kotori-bot/kotori-plugin-core
4
+ * @Version 1.3.0
5
+ * @Author Hotaru <biyuehuya@gmail.com>
6
+ * @Copyright 2024 Hotaru. All rights reserved.
7
+ * @License GPL-3.0
8
+ * @Link https://github.com/kotorijs/kotori
9
+ * @Date 2024/6/7 11:22:14
8
10
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.main = exports.lang = void 0;
11
- const kotori_bot_1 = require("kotori-bot");
12
- exports.lang = [__dirname, '../locales'];
11
+
12
+ "use strict";
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ lang: () => lang,
33
+ main: () => main
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+ var import_kotori_bot = require("kotori-bot");
37
+ const lang = [__dirname, "../locales"];
13
38
  function main(ctx) {
14
- ctx.command('core - core.descr.core').action((_, session) => {
15
- const { config, baseDir, options } = session.api.adapter.ctx;
16
- let botsLength = 0;
17
- ctx[kotori_bot_1.Symbols.bot].forEach((bots) => bots.forEach(() => {
18
- botsLength += 1;
19
- }));
20
- return [
21
- 'core.msg.core',
22
- {
23
- lang: config.global.lang,
24
- root: baseDir.root,
25
- mode: options.mode,
26
- modules: ctx[kotori_bot_1.Symbols.modules] ? ctx[kotori_bot_1.Symbols.modules].size : 0,
27
- services: ctx[kotori_bot_1.Symbols.adapter].size,
28
- bots: botsLength,
29
- midwares: ctx[kotori_bot_1.Symbols.midware].size,
30
- commands: ctx[kotori_bot_1.Symbols.command].size,
31
- regexps: ctx[kotori_bot_1.Symbols.regexp].size
32
- }
33
- ];
34
- });
35
- ctx.command('bot - core.descr.bot').action((_, session) => {
36
- const { identity, platform, selfId, config, status } = session.api.adapter;
37
- return [
38
- 'core.msg.bot',
39
- {
40
- identity,
41
- lang: config.lang,
42
- platform,
43
- self_id: selfId,
44
- create_time: session.i18n.time(status.createTime),
45
- last_msg_time: status.lastMsgTime ? session.i18n.time(status.lastMsgTime) : '',
46
- received_msg: status.receivedMsg,
47
- sent_msg: status.sentMsg,
48
- offline_times: status.offlineTimes
49
- }
50
- ];
51
- });
52
- ctx.command('bots - core.descr.bots').action((_, session) => {
53
- let list = '';
54
- ctx[kotori_bot_1.Symbols.bot].forEach((bots) => bots.forEach((bot) => {
55
- const { identity, platform, config, status } = bot.adapter;
56
- list += session.format('core.msg.bots.list', {
57
- identity,
58
- lang: config.lang,
59
- platform,
60
- status: status.value
61
- });
62
- }));
63
- return ['core.msg.bots', { list }];
64
- });
65
- ctx.command('about - core.descr.about').action((_, session) => {
66
- const { version, license } = session.api.adapter.ctx.pkg;
67
- return ['core.msg.about', { version, license, node_version: process.version }];
39
+ ctx.on("parse", (data) => {
40
+ const { quick } = data.session;
41
+ if (!(data.result instanceof import_kotori_bot.CommandError)) {
42
+ const { scope, access } = data.command.meta;
43
+ if (scope && scope !== "all" && data.session.type !== scope) {
44
+ quick("corei18n.template.scope");
45
+ data.cancel();
46
+ } else if (data.session.userId !== data.session.api.adapter.config.master) {
47
+ if (access === import_kotori_bot.CommandAccess.ADMIN) {
48
+ quick("corei18n.template.no_access_admin");
49
+ data.cancel();
50
+ } else if (access === import_kotori_bot.CommandAccess.MANGER && (data.session.type === import_kotori_bot.MessageScope.PRIVATE || data.session.sender.role === "member")) {
51
+ quick("corei18n.template.no_access_manger");
52
+ data.cancel();
53
+ }
54
+ }
55
+ return;
56
+ }
57
+ data.cancel();
58
+ const { value } = data.result;
59
+ switch (value.type) {
60
+ case "arg_error":
61
+ quick(["corei18n.template.args_error", [value.index, value.expected, value.reality]]);
62
+ break;
63
+ case "arg_few":
64
+ quick(["corei18n.template.args_few", [value.expected, value.reality]]);
65
+ break;
66
+ case "arg_many":
67
+ quick(["corei18n.template.args_many", [value.expected, value.reality]]);
68
+ break;
69
+ case "option_error":
70
+ quick(["corei18n.template.option_error", [value.target, value.expected, value.reality]]);
71
+ break;
72
+ case "syntax":
73
+ quick(["corei18n.template.syntax", [value.index, value.char]]);
74
+ break;
75
+ case "unknown":
76
+ quick(["corei18n.template.unknown", [value.input]]);
77
+ break;
78
+ default:
79
+ }
80
+ });
81
+ ctx.on("command", (data) => {
82
+ if (!(data.result instanceof import_kotori_bot.CommandError)) return;
83
+ const { value } = data.result;
84
+ const { quick } = data.session;
85
+ switch (value.type) {
86
+ case "res_error":
87
+ quick(["corei18n.template.res_error", [value.error.message]]);
88
+ break;
89
+ case "num_error":
90
+ quick("corei18n.template.num_error");
91
+ break;
92
+ case "no_access_manger":
93
+ quick("corei18n.template.no_access_manger");
94
+ break;
95
+ case "no_access_admin":
96
+ quick("corei18n.template.no_access_admin");
97
+ break;
98
+ case "disable":
99
+ quick("corei18n.template.disable");
100
+ break;
101
+ case "exists":
102
+ quick(["corei18n.template.exists", [value.target]]);
103
+ break;
104
+ case "no_exists":
105
+ quick(["corei18n.template.no_exists", [value.target]]);
106
+ break;
107
+ case "error":
108
+ ctx.logger.error(value.error);
109
+ if (value.error instanceof import_kotori_bot.TsuError) {
110
+ quick(["corei18n.template.res_error", [value.error.message]]);
111
+ return;
112
+ }
113
+ if (value.error instanceof Error) {
114
+ quick(["corei18n.template.error", [`${value.error.name} ${value.error.message}`]]);
115
+ return;
116
+ }
117
+ if (typeof value.error === "object") {
118
+ quick(["corei18n.template.error", [JSON.stringify(value.error)]]);
119
+ return;
120
+ }
121
+ quick(["corei18n.template.error", [String(value.error)]]);
122
+ break;
123
+ case "data_error":
124
+ quick([
125
+ `corei18n.template.data_error.${typeof value.target === "string" ? "options" : "args"}`,
126
+ [value.target]
127
+ ]);
128
+ break;
129
+ default:
130
+ }
131
+ });
132
+ ctx.command("core - core.descr.core").action((_, session) => {
133
+ const { config, baseDir, options } = session.api.adapter.ctx;
134
+ let botsLength = 0;
135
+ ctx[import_kotori_bot.Symbols.bot].forEach(
136
+ (bots) => bots.forEach(() => {
137
+ botsLength += 1;
138
+ })
139
+ );
140
+ return [
141
+ "core.msg.core",
142
+ {
143
+ lang: config.global.lang,
144
+ root: baseDir.root,
145
+ mode: options.mode,
146
+ modules: ctx[import_kotori_bot.Symbols.modules] ? ctx[import_kotori_bot.Symbols.modules].size : 0,
147
+ services: ctx[import_kotori_bot.Symbols.adapter].size,
148
+ bots: botsLength,
149
+ midwares: ctx[import_kotori_bot.Symbols.midware].size,
150
+ commands: ctx[import_kotori_bot.Symbols.command].size,
151
+ regexps: ctx[import_kotori_bot.Symbols.regexp].size
152
+ }
153
+ ];
154
+ });
155
+ ctx.command("bot - core.descr.bot").action((_, session) => {
156
+ const { identity, platform, selfId, config, status } = session.api.adapter;
157
+ return [
158
+ "core.msg.bot",
159
+ {
160
+ identity,
161
+ lang: config.lang,
162
+ platform,
163
+ self_id: selfId,
164
+ create_time: session.i18n.time(status.createTime),
165
+ last_msg_time: status.lastMsgTime ? session.i18n.time(status.lastMsgTime) : "",
166
+ received_msg: status.receivedMsg,
167
+ sent_msg: status.sentMsg,
168
+ offline_times: status.offlineTimes
169
+ }
170
+ ];
171
+ });
172
+ ctx.command("bots - core.descr.bots").action((_, session) => {
173
+ let list = "";
174
+ ctx[import_kotori_bot.Symbols.bot].forEach(
175
+ (bots) => bots.forEach((bot) => {
176
+ const { identity, platform, config, status } = bot.adapter;
177
+ list += session.format("core.msg.bots.list", {
178
+ identity,
179
+ lang: config.lang,
180
+ platform,
181
+ status: status.value
182
+ });
183
+ })
184
+ );
185
+ return ["core.msg.bots", { list }];
186
+ });
187
+ ctx.command("about - core.descr.about").action((_, session) => {
188
+ const { version, license } = session.api.adapter.ctx.pkg;
189
+ return ["core.msg.about", { version, license, node_version: process.version }];
190
+ });
191
+ ctx.command("locale <lang> - core.descr.locale").option("G", "global:boolean - core.option.locale.global").action(({ args: [lang2], options: { global } }, session) => {
192
+ const { adapter } = session.api;
193
+ if (!["en_US", "ja_JP", "zh_CN", "zh_TW"].includes(lang2)) return "core.msg.locale.invalid";
194
+ if (global) {
195
+ adapter.ctx.root.config.global.lang = lang2;
196
+ adapter.ctx[import_kotori_bot.Symbols.bot].forEach(
197
+ (apis) => apis.forEach((api) => {
198
+ const { adapter: adapter2 } = api;
199
+ adapter2.config.lang = lang2;
200
+ })
201
+ );
202
+ } else {
203
+ adapter.config.lang = lang2;
204
+ }
205
+ return session.quick([`core.msg.locale${global ? ".global" : ""}`, { lang: lang2 }]);
206
+ });
207
+ ctx.command("module - core.descr.module").action((_, session) => {
208
+ let list = "";
209
+ ctx[import_kotori_bot.Symbols.modules].forEach(([{ pkg }]) => {
210
+ list += session.format("core.msg.module.list", {
211
+ name: pkg.name,
212
+ version: pkg.version,
213
+ description: pkg.description
214
+ });
68
215
  });
216
+ return ["core.msg.module", { list }];
217
+ });
69
218
  }
70
- exports.main = main;
219
+ // Annotate the CommonJS export names for ESM import in node:
220
+ 0 && (module.exports = {
221
+ lang,
222
+ main
223
+ });
@@ -1,11 +1,40 @@
1
1
  {
2
- "core.descr.core": "View instance statistics",
3
- "core.descr.bot": "View current bot info and running status",
4
- "core.descr.bots": "View all bots info and running status",
5
- "core.descr.about": "View about info",
6
- "core.msg.bot": "ID: %identity%\nLanguage: %lang%\nPlatform: %platform%\nSelf ID: %self_id%\nConnect Time: %create_time%\nMessages Received: %received_msg%\nMessages Sent: %sent_msg%\nOffline Times: %offline_times%\nLast Message Time: %last_msg_time%",
7
- "core.msg.core": "Global Language: %lang%\nRoot Directory: %root%\nRunning Mode: %mode%\nNumber of Modules: %modules%\nNumber of Services: %services%\nNumber of Bots: %bots%\nNumber of Middlewares: %midwares%\nNumber of Commands: %commands%\nNumber of Regexps: %regexps%",
8
- "core.msg.bots": "Bot List: %list%",
2
+ "corei18n.template.args_error": "The type of argument \"{0}\" is incorrect, expected type: {1}, actual type: {2}",
3
+ "corei18n.template.args_few": "Fewer arguments than expected were provided. Expected number: {0}, actual number: {1}",
4
+ "corei18n.template.args_many": "More arguments than expected were provided. Please reduce the number of arguments. Expected number: {0}, actual number: {1}",
5
+ "corei18n.template.option_error": "The type of option \"{0}\" is incorrect, expected type: {1}, actual type: {2}",
6
+ "corei18n.template.syntax": "Syntax error in command. Unexpected character \"{1}\" at position {0}",
7
+ "corei18n.template.unknown": "Unknown command \"{0}\". Please check if the command is entered correctly",
8
+ "corei18n.template.error": "An unexpected error has occurred!\nCaptured information: {0}",
9
+ "corei18n.template.res_error": "Error in response data format!\nError message: {0}",
10
+ "corei18n.template.num_error": "Incorrect sequence number, please resend",
11
+ "corei18n.template.exists": "The target argument \"{0}\" already exists, do not execute repeatedly",
12
+ "corei18n.template.no_exists": "The target argument \"{0}\" does not exist, please confirm and resend",
13
+ "corei18n.template.data_error.args": "Error in data passed to argument \"{0}\"",
14
+ "corei18n.template.data_error.options": "Error in data passed to option \"{0}\"",
15
+ "corei18n.template.scope": "This command can only be used in group chats or private chats!",
16
+ "corei18n.template.no_access_manger": "This command can only be used by group managers and group BOT administrators!",
17
+ "corei18n.template.no_access_admin": "This command can only be used by the highest administrator of the BOT!",
18
+ "corei18n.template.empty": "None",
19
+ "corei18n.template.unsupported": "The current platform does not support this message element",
20
+ "corei18n.template": "The current platform does not support this message element",
21
+ "corei18n.template.prompt": "Please enter a value:",
22
+ "corei18n.template.confirm": "Are you sure? (Yes/No)",
23
+ "corei18n.template.confirm.sure": "Yes",
24
+ "core.descr.core": "View instance statistics information",
25
+ "core.descr.bot": "View information and status of the current bot",
26
+ "core.descr.bots": "View information and status of all bots",
27
+ "core.descr.about": "View about information",
28
+ "core.descr.locale": "Set the display language",
29
+ "core.descr.module": "View the list of modules",
30
+ "core.msg.bot": "ID: %identity%\nLanguage: %lang%\nPlatform: %platform%\nID: %self_id%\nConnection time: %create_time%\nNumber of received messages: %received_msg%\nNumber of sent messages: %sent_msg%\nNumber of instance shutdowns: %offline_times%\nLast message time: %last_msg_time%",
31
+ "core.msg.core": "Global language: %lang%\nInstance directory: %root%\nRunning mode: %mode%\nNumber of modules: %modules%\nNumber of services: %services%\nNumber of bot instances: %bots%\nNumber of middlewares: %midwares%\nNumber of commands: %commands%\nNumber of regular expressions: %regexps%",
32
+ "core.msg.bots": "Instance list: %list%",
9
33
  "core.msg.bots.list": "\n----------\nID: %identity%\nLanguage: %lang%\nPlatform: %platform%\nStatus: %status%",
10
- "core.msg.about": "Kotori Version: %version%\nLicense: %license%\nNodeJS Version: %node_version%"
11
- }
34
+ "core.msg.about": "Kotori version: %version%\nLicense: %license%\nNodeJS version: %node_version%",
35
+ "core.msg.locale": "Successfully set the display language for the current instance to: %lang%",
36
+ "core.msg.locale.global": "Successfully set the global display language to: %lang%",
37
+ "core.msg.locale.invalid": "Parameter is invalid, must be one of the following values: en_US, ja_JP, zh_CN, zh_TW",
38
+ "core.msg.module": "Module list: %list%",
39
+ "core.msg.module.list": "\n----------\nName: %name%\nDescription: %description%\nVersion: %version%"
40
+ }
@@ -1,11 +1,40 @@
1
1
  {
2
- "core.descr.core": "インスタンスの統計を表示",
3
- "core.descr.bot": "現在のbotの情報と実行状態を表示",
4
- "core.descr.bots": "すべてのbotの情報と実行状態を表示",
5
- "core.descr.about": "バージョン情報を表示",
6
- "core.msg.bot": "ID:%identity%\n言語:%lang%\nプラットフォーム:%platform%\nセルフID:%self_id%\n接続時間:%create_time%\n受信メッセージ数:%received_msg%\n送信メッセージ数:%sent_msg%\nオフライン回数:%offline_times%\n最終メッセージ時間:%last_msg_time%",
7
- "core.msg.core": "グローバル言語:%lang%\nルートディレクトリ:%root%\n実行モード:%mode%\nモジュール数:%modules%\nサービス数:%services%\nボットインスタンス数:%bots%\nミドルウェア数:%midwares%\nコマンド数:%commands%\n正規表現数:%regexps%",
8
- "core.msg.bots": "ボットリスト:%list%",
2
+ "corei18n.template.args_error": "パラメータ「{0}」の型が誤っています。期待する型:{1}、実際の型:{2}",
3
+ "corei18n.template.args_few": "期待される引数の数が不足しています。期待される数:{0}、実際の数:{1}",
4
+ "corei18n.template.args_many": "引数の数が多すぎます。期待される数:{0}、実際の数:{1}",
5
+ "corei18n.template.option_error": "オプション「{0}」の型が誤っています。期待する型:{1}、実際の型:{2}",
6
+ "corei18n.template.syntax": "コマンドの構文エラー、{0}の位置で予期しない文字「{1}」",
7
+ "corei18n.template.unknown": "未知のコマンド「{0}」、コマンドの入力を確認してください",
8
+ "corei18n.template.error": "予期しないエラーが発生しました!\n捕捉された情報:{0}",
9
+ "corei18n.template.res_error": "レスポンスデータの形式が誤っています!\nエラーメッセージ:{0}",
10
+ "corei18n.template.num_error": "番号が誤っています、再度送信してください",
11
+ "corei18n.template.exists": "対象のパラメータ「{0}」はすでに存在しています、繰り返し実行しないでください",
12
+ "corei18n.template.no_exists": "対象のパラメータ「{0}」は存在していません、確認後、再度送信してください",
13
+ "corei18n.template.data_error.args": "パラメータ「{0}」に誤ったデータが渡されました",
14
+ "corei18n.template.data_error.options": "オプション「{0}」に誤ったデータが渡されました",
15
+ "corei18n.template.scope": "このコマンドはグループチャットまたはプライベートチャットでのみ使用できます!",
16
+ "corei18n.template.no_access_manger": "このコマンドはグループ管理者およびBOT管理者のみ使用できます!",
17
+ "corei18n.template.no_access_admin": "このコマンドはBOTの最高管理者のみ使用できます!",
18
+ "corei18n.template.empty": "なし",
19
+ "corei18n.template.unsupported": "現在のプラットフォームではこのメッセージ要素はサポートされていません",
20
+ "corei18n.template": "現在のプラットフォームではこのメッセージ要素はサポートされていません",
21
+ "corei18n.template.prompt": "値を入力してください:",
22
+ "corei18n.template.confirm": "確認しますか?(はい/いいえ)",
23
+ "corei18n.template.confirm.sure": "はい",
24
+ "core.descr.core": "インスタンスの統計情報を表示します",
25
+ "core.descr.bot": "現在のBOTの情報と動作状況を表示します",
26
+ "core.descr.bots": "すべてのBOTの情報と動作状況を表示します",
27
+ "core.descr.about": "について情報を表示します",
28
+ "core.descr.locale": "表示言語を設定します",
29
+ "core.descr.module": "モジュールを表示します",
30
+ "core.msg.bot": "ID:%identity%\n言語:%lang%\nプラットフォーム:%platform%\nID:%self_id%\n接続時間:%create_time%\n受信メッセージ数:%received_msg%\n送信メッセージ数:%sent_msg%\nインスタンスオフライン回数:%offline_times%\n最後のメッセージ時間:%last_msg_time%",
31
+ "core.msg.core": "グローバル言語:%lang%\nインスタンスディレクトリ:%root%\n動作モード:%mode%\nモジュール数:%modules%\nサービス数:%services%\nBOTインスタンス数:%bots%\nミドルウェア数:%midwares%\nコマンド数:%commands%\n正規表現数:%regexps%",
32
+ "core.msg.bots": "インスタンスリスト:%list%",
9
33
  "core.msg.bots.list": "\n----------\nID:%identity%\n言語:%lang%\nプラットフォーム:%platform%\n状態:%status%",
10
- "core.msg.about": "Kotoriバージョン:%version%\nライセンス:%license%\nNodeJSバージョン:%node_version%"
11
- }
34
+ "core.msg.about": "Kotori バージョン:%version%\nライセンス:%license%\nNodeJS バージョン:%node_version%",
35
+ "core.msg.locale": "現在のインスタンスの表示言語を %lang% に設定しました",
36
+ "core.msg.locale.global": "グローバル表示言語を %lang% に設定しました",
37
+ "core.msg.locale.invalid": "パラメータが無効です。以下の値のいずれかでなければなりません:en_US、ja_JP、zh_CN、zh_TW",
38
+ "core.msg.module": "モジュールリスト:%list%",
39
+ "core.msg.module.list": "\n----------\n名前:%name%\n説明:%description%\nバージョン:%version%"
40
+ }
@@ -1,11 +1,40 @@
1
- {
2
- "core.descr.core": "查看实例统计信息",
3
- "core.descr.bot": "查看当前 bot 信息与运行状态",
4
- "core.descr.bots": "查看所有 bot 信息与运行状态",
5
- "core.descr.about": "查看关于信息",
6
- "core.msg.bot": "ID:%identity%\n语言:%lang%\n平台:%platform%\nid:%self_id%\n连接时间:%create_time%\n接收消息数量:%received_msg%\n发送消息数量:%sent_msg%\n实例下线次数:%offline_times%\n最后消息时间:%last_msg_time%",
7
- "core.msg.core": "全局语言:%lang%\n实例目录:%root%\n运行模式:%mode%\n模块数量:%modules%\n服务数量:%services%\nbot 实例数量:%bots%\n中间件数量:%midwares%\n指令数量:%commands%\n正则数量:%regexps%",
8
- "core.msg.bots": "实例列表:%list%",
9
- "core.msg.bots.list": "\n----------\nID:%identity%\n语言:%lang%\n平台:%platform%\n状态:%status%",
10
- "core.msg.about": "Kotori 版本:%version%\n协议:%license%\nNodeJS 版本:%node_version%"
11
- }
1
+ {
2
+ "corei18n.template.args_error": "参数 “{0}” 的类型错误,期望类型:{1} 实际类型:{2}",
3
+ "corei18n.template.args_few": "输入参数过少请增加参数,期望数量:{0} 实际数量:{1}",
4
+ "corei18n.template.args_many": "输入参数过多请减少参数,期望数量:{0} 实际数量:{1}",
5
+ "corei18n.template.option_error": "选项 “{0}” 的类型错误,期望类型:{1} 实际类型:{2}",
6
+ "corei18n.template.syntax": "指令语法错误,意外地在 {0} 处字符 “{1}”",
7
+ "corei18n.template.unknown": "未知的指令 “{0}” ,请检查指令是否输入正确",
8
+ "corei18n.template.error": "意外的错误!\n捕获信息:{0}",
9
+ "corei18n.template.res_error": "响应数据格式错误!\n错误信息:{0}",
10
+ "corei18n.template.num_error": "序号错误,请重新发送",
11
+ "corei18n.template.exists": "目标参数“{0}”已存在,请勿重复执行",
12
+ "corei18n.template.no_exists": "目标参数“{0}”不存在,请确认后,重新发送",
13
+ "corei18n.template.data_error.args": "参数 “{0}” 传入数据错误",
14
+ "corei18n.template.data_error.options": "选项 “{0}” 传入数据错误",
15
+ "corei18n.template.scope": "该指令仅群聊或私聊下可使用!",
16
+ "corei18n.template.no_access_manger": "该指令仅群管理员与群BOT管理员可使用!",
17
+ "corei18n.template.no_access_admin": "该指令仅BOT最高管理员可使用!",
18
+ "corei18n.template.empty": "无",
19
+ "corei18n.template.unsupported": "当前平台不支持该消息元素",
20
+ "corei18n.template.": "当前平台不支持该消息元素",
21
+ "corei18n.template.prompt": "请输入一个值:",
22
+ "corei18n.template.confirm": "是否确认?(是/否)",
23
+ "corei18n.template.confirm.sure": "是",
24
+ "core.descr.core": "查看实例统计信息",
25
+ "core.descr.bot": "查看当前 bot 信息与运行状态",
26
+ "core.descr.bots": "查看所有 bot 信息与运行状态",
27
+ "core.descr.about": "查看关于信息",
28
+ "core.descr.locale": "设置显示语言",
29
+ "core.descr.module": "查看模块",
30
+ "core.msg.bot": "ID:%identity%\n语言:%lang%\n平台:%platform%\nid:%self_id%\n连接时间:%create_time%\n接收消息数量:%received_msg%\n发送消息数量:%sent_msg%\n实例下线次数:%offline_times%\n最后消息时间:%last_msg_time%",
31
+ "core.msg.core": "全局语言:%lang%\n实例目录:%root%\n运行模式:%mode%\n模块数量:%modules%\n服务数量:%services%\nbot 实例数量:%bots%\n中间件数量:%midwares%\n指令数量:%commands%\n正则数量:%regexps%",
32
+ "core.msg.bots": "实例列表:%list%",
33
+ "core.msg.bots.list": "\n----------\nID:%identity%\n语言:%lang%\n平台:%platform%\n状态:%status%",
34
+ "core.msg.about": "Kotori 版本:%version%\n协议:%license%\nNodeJS 版本:%node_version%",
35
+ "core.msg.locale": "成功将当前实例显示语言设置为:%lang%",
36
+ "core.msg.locale.global": "成功将全局显示语言设置为:%lang%",
37
+ "core.msg.locale.invalid": "参数无效,必须是以下中的一个值:en_US、ja_JP、zh_CN、zh_TW",
38
+ "core.msg.module": "模块列表:%list%",
39
+ "core.msg.module.list": "\n----------\n名称:%name%\n描述:%description%\n版本:%version%"
40
+ }
@@ -1,11 +1,40 @@
1
- {
2
- "core.descr.core": "查看實例統計信息",
3
- "core.descr.bot": "查看當前 bot 信息與運行狀態",
4
- "core.descr.bots": "查看所有 bot 信息與運行狀態",
5
- "core.descr.about": "查看關于信息",
6
- "core.msg.bot": "ID:%identity%\n語言:%lang%\n平台:%platform%\nid:%self_id%\n連接時間:%create_time%\n接收消息數量:%received_msg%\n發送消息數量:%sent_msg%\n實例下線次數:%offline_times%\n最後消息時間:%last_msg_time%",
7
- "core.msg.core": "全局語言:%lang%\n實例目錄:%root%\n運行模式:%mode%\n模塊數量:%modules%\n服務數量:%services%\nbot 實例數量:%bots%\n中間件數量:%midwares%\n指令數量:%commands%\n正則數量:%regexps%",
8
- "core.msg.bots": "實例列表:%list%",
9
- "core.msg.bots.list": "\n----------\nID:%identity%\n語言:%lang%\n平台:%platform%\n狀態:%status%",
10
- "core.msg.about": "Kotori 版本:%version%\n協議:%license%\nNodeJS 版本:%node_version%"
11
- }
1
+ {
2
+ "corei18n.template.args_error": "參數 “{0}” 的類型錯誤,期望類型:{1} 實際類型:{2}",
3
+ "corei18n.template.args_few": "輸入參數過少請增加參數,期望數量:{0} 實際數量:{1}",
4
+ "corei18n.template.args_many": "輸入參數過多請減少參數,期望數量:{0} 實際數量:{1}",
5
+ "corei18n.template.option_error": "選項 “{0}” 的類型錯誤,期望類型:{1} 實際類型:{2}",
6
+ "corei18n.template.syntax": "指令語法錯誤,意外地在 {0} 處字符 “{1}”",
7
+ "corei18n.template.unknown": "未知的指令 “{0}” ,請檢查指令是否輸入正確",
8
+ "corei18n.template.error": "意外的錯誤!\n捕獲信息:{0}",
9
+ "corei18n.template.res_error": "響應數據格式錯誤!\n錯誤信息:{0}",
10
+ "corei18n.template.num_error": "序號錯誤,請重新發送",
11
+ "corei18n.template.exists": "目標參數“{0}”已存在,請勿重複執行",
12
+ "corei18n.template.no_exists": "目標參數“{0}”不存在,請確認後,重新發送",
13
+ "corei18n.template.data_error.args": "參數 “{0}” 傳入數據錯誤",
14
+ "corei18n.template.data_error.options": "選項 “{0}” 傳入數據錯誤",
15
+ "corei18n.template.scope": "該指令僅群聊或私聊下可使用!",
16
+ "corei18n.template.no_access_manger": "該指令僅群管理員與群BOT管理員可使用!",
17
+ "corei18n.template.no_access_admin": "該指令僅BOT最高管理員可使用!",
18
+ "corei18n.template.empty": "無",
19
+ "corei18n.template.unsupported": "當前平台不支持該消息元素",
20
+ "corei18n.template.": "當前平台不支持該消息元素",
21
+ "corei18n.template.prompt": "請輸入壹個值:",
22
+ "corei18n.template.confirm": "是否確認?(是/否)",
23
+ "corei18n.template.confirm.sure": "是",
24
+ "core.descr.core": "查看實例統計信息",
25
+ "core.descr.bot": "查看當前 bot 信息與運行狀態",
26
+ "core.descr.bots": "查看所有 bot 信息與運行狀態",
27
+ "core.descr.about": "查看關于信息",
28
+ "core.descr.locale": "設置顯示語言",
29
+ "core.descr.module": "查看模塊",
30
+ "core.msg.bot": "ID:%identity%\n語言:%lang%\n平台:%platform%\nid:%self_id%\n連接時間:%create_time%\n接收消息數量:%received_msg%\n發送消息數量:%sent_msg%\n實例下線次數:%offline_times%\n最後消息時間:%last_msg_time%",
31
+ "core.msg.core": "全局語言:%lang%\n實例目錄:%root%\n運行模式:%mode%\n模塊數量:%modules%\n服務數量:%services%\nbot 實例數量:%bots%\n中間件數量:%midwares%\n指令數量:%commands%\n正則數量:%regexps%",
32
+ "core.msg.bots": "實例列表:%list%",
33
+ "core.msg.bots.list": "\n----------\nID:%identity%\n語言:%lang%\n平台:%platform%\n狀態:%status%",
34
+ "core.msg.about": "Kotori 版本:%version%\n協議:%license%\nNodeJS 版本:%node_version%",
35
+ "core.msg.locale": "成功將當前實例顯示語言設置爲:%lang%",
36
+ "core.msg.locale.global": "成功將全局顯示語言設置爲:%lang%",
37
+ "core.msg.locale.invalid": "參數無效,必須是以下中的壹個值:en_US、ja_JP、zh_CN、zh_TW",
38
+ "core.msg.module": "模塊列表:%list%",
39
+ "core.msg.module.list": "\n----------\n名稱:%name%\n描述:%description%\n版本:%version%"
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kotori-bot/kotori-plugin-core",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "core plugin",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "author": "Hotaru <biyuehuya@gmail.com>",
19
19
  "peerDependencies": {
20
- "kotori-bot": "^1.3.0"
20
+ "kotori-bot": "^1.5.1"
21
21
  },
22
22
  "kotori": {
23
23
  "meta": {
@@ -28,8 +28,5 @@
28
28
  "zh_CN"
29
29
  ]
30
30
  }
31
- },
32
- "scripts": {
33
- "build": "tsc --build"
34
31
  }
35
32
  }