koishi-plugin-node-async-bot-all 2.22.1 → 2.23.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.
- package/lib/commands.d.ts +20 -1
- package/lib/fun.d.ts +18 -9
- package/lib/index.d.ts +6 -11
- package/lib/index.js +72 -75
- package/package.json +1 -2
package/lib/commands.d.ts
CHANGED
|
@@ -44,13 +44,32 @@ interface NewsItem {
|
|
|
44
44
|
feed_type: number;
|
|
45
45
|
appid: number;
|
|
46
46
|
}
|
|
47
|
+
interface Heartbeat {
|
|
48
|
+
status: 0 | 1;
|
|
49
|
+
time: string;
|
|
50
|
+
msg: string;
|
|
51
|
+
ping: number | null;
|
|
52
|
+
}
|
|
53
|
+
interface HeartbeatList {
|
|
54
|
+
[monitorId: string]: Heartbeat[];
|
|
55
|
+
}
|
|
56
|
+
interface UptimeList {
|
|
57
|
+
[periodKey: string]: number;
|
|
58
|
+
}
|
|
59
|
+
export interface MonitorStatusResponse {
|
|
60
|
+
heartbeatList: HeartbeatList;
|
|
61
|
+
uptimeList: UptimeList;
|
|
62
|
+
}
|
|
47
63
|
export declare function getServer(ctx: Context, session: Session): Promise<Object>;
|
|
48
64
|
export declare function getStatus(ctx: Context, session: Session): Promise<Object>;
|
|
49
65
|
export declare function getRandom(ctx: Context, session: Session, min: number, max: number): Promise<Object>;
|
|
50
66
|
export declare function getInfo(ctx: Context, session: Session): Promise<Object>;
|
|
51
67
|
export declare function getRandomWord(ctx: Context, session: Session): Promise<Object>;
|
|
52
68
|
export declare function getBlueArchive(ctx: Context, session: Session): Promise<Number>;
|
|
53
|
-
export declare function
|
|
69
|
+
export declare function centerServerTest(ctx: Context, session: Session): Promise<{
|
|
70
|
+
success: string;
|
|
71
|
+
data: object;
|
|
72
|
+
}>;
|
|
54
73
|
export declare function getMeme(ctx: Context, session: Session, count: number): Promise<Number>;
|
|
55
74
|
export declare function getCat(ctx: Context, session: Session): Promise<Number>;
|
|
56
75
|
export declare function getQQInfo(ctx: Context, session: Session, qq: string): Promise<number>;
|
package/lib/fun.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { HttpResponse } from "./index";
|
|
2
1
|
import { Context } from "koishi";
|
|
3
2
|
import { APINews, APIUserInfo } from "./commands";
|
|
3
|
+
export type HttpResponse<T> = {
|
|
4
|
+
success: true;
|
|
5
|
+
data: T;
|
|
6
|
+
} | {
|
|
7
|
+
success: false;
|
|
8
|
+
error: any;
|
|
9
|
+
code?: number;
|
|
10
|
+
isJson: boolean;
|
|
11
|
+
};
|
|
4
12
|
export type serverInfo = {
|
|
5
13
|
players: string;
|
|
6
14
|
protocol: number;
|
|
@@ -12,18 +20,19 @@ export type serverInfo = {
|
|
|
12
20
|
success: false;
|
|
13
21
|
error: any;
|
|
14
22
|
};
|
|
15
|
-
export declare function getSystemUsage(): Promise<
|
|
23
|
+
export declare function getSystemUsage(): Promise<{
|
|
24
|
+
name: string;
|
|
25
|
+
cpu: string;
|
|
26
|
+
memory: string;
|
|
27
|
+
success: 0;
|
|
28
|
+
} | {
|
|
29
|
+
data: string;
|
|
30
|
+
success: 1;
|
|
31
|
+
}>;
|
|
16
32
|
export declare function getHongKongTime(): string;
|
|
17
33
|
export declare function readInfoFile(ctx: Context): Promise<string>;
|
|
18
34
|
export declare function formatTimestampDiff(start: number, end: number): string;
|
|
19
35
|
export declare function getMsgCount(ctx: Context): Promise<Object>;
|
|
20
|
-
export declare function hostPing(host: string): Promise<{
|
|
21
|
-
success: boolean;
|
|
22
|
-
data?: any;
|
|
23
|
-
ip?: string;
|
|
24
|
-
alive?: boolean;
|
|
25
|
-
packetLoss?: string;
|
|
26
|
-
}>;
|
|
27
36
|
export declare function random(type: number | undefined, data: any, data2?: any): number;
|
|
28
37
|
export declare function request<T = any>(url: string, options?: RequestInit, timeout?: number, log?: any): Promise<HttpResponse<T>>;
|
|
29
38
|
export declare function readUserCardFile(userInfo: APIUserInfo): Promise<string>;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { Context, Dict, Schema } from 'koishi';
|
|
2
2
|
export declare const inject: string[];
|
|
3
|
-
export type HttpResponse<T> = {
|
|
4
|
-
success: true;
|
|
5
|
-
data: T;
|
|
6
|
-
} | {
|
|
7
|
-
success: false;
|
|
8
|
-
error: any;
|
|
9
|
-
code?: number;
|
|
10
|
-
isJson: boolean;
|
|
11
|
-
};
|
|
12
3
|
declare module 'koishi' {
|
|
13
4
|
interface Tables {
|
|
14
5
|
botData: botDataTables;
|
|
@@ -27,17 +18,21 @@ export interface ConfigCxV3 {
|
|
|
27
18
|
id: string;
|
|
28
19
|
server: Array<ConfigV3Server>;
|
|
29
20
|
}
|
|
30
|
-
|
|
21
|
+
interface ConfigV3Server {
|
|
31
22
|
api: string;
|
|
32
23
|
note: string;
|
|
33
24
|
type: "mc" | "a2s" | null | undefined;
|
|
34
25
|
}
|
|
26
|
+
interface CenterServerConfig {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
35
30
|
export interface Config {
|
|
36
31
|
cxV3: Array<ConfigCxV3>;
|
|
37
32
|
rwAPI: string;
|
|
38
33
|
timeout: number;
|
|
39
34
|
baAPI: string[];
|
|
40
|
-
|
|
35
|
+
slTest: CenterServerConfig[];
|
|
41
36
|
steamAPI: string;
|
|
42
37
|
memesAPI: Dict<string>;
|
|
43
38
|
catAPI: string;
|
package/lib/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
// src/locales/zh-CN.yml
|
|
35
35
|
var require_zh_CN = __commonJS({
|
|
36
36
|
"src/locales/zh-CN.yml"(exports2, module2) {
|
|
37
|
-
module2.exports = { commands: { cxgame: { description: "查询服务器当前人数。", messages: { msg: "{time}{list}\n进服指南请在群公告中查看。", list: "【MC 服务器 {count}】\n➣ {version}:{players}\n➣ 玩家列表:{list}\n➣ 备注:{note}", listNoPlayer: "【MC 服务器 {count}】\n➣ {version}:{players}\n➣ 备注:{note}", listFailed: "【MC 服务器 {count}】\n➣ 查询失败:{data}\n➣ 请稍后重试。\n➣ 备注:{note}", listA2S: "【A2S 服务器 {count}】\n➣ {version}:{players}\n➣ 机器人:{bots}\n➣ 备注:{note}", listFailedA2S: "【A2S 服务器 {count}】\n➣ 查询失败:{data}\n➣ 请稍后重试。\n➣ 备注:{note}", forbidden: "{time}\n此指令不允许在本群使用。", failed: "{time}\n查询失败:{data}", timeout: "请求超时。", timeout2: "响应超时。", fewData: "服务端返回的数据过少。", close: "服务器已关闭。", error: "执行错误。", host: "没有到主机的路由。" } }, status: { description: "查询机器人状态。", messages: { msg: "{time}\n--- 系统状态 ---\n系统名称:{name}\nCPU使用率:{cpu}\n内存使用率:{memory}\n--- 机器人状态 ---\n昨日收/发消息数量:{msgCount}\n机器人版本:{version}\n运行时间:{online}", failed: "{time}\n状态获取失败。" } }, random: { description: "随机数生成器。", usage: "缺少参数时默认生成 0-10000 的随机数。\n使用示例:", examples: "random 1 128 生成1到128范围的随机数", messages: { msg: "{time}\n生成的随机数:{data}" } }, info: { description: "查询机器人信息。", messages: { msg: "{data}", failed: "{time}\n读取信息失败。" } }, rw: { description: "随机名言名句。", messages: { msg: "{time}\n{data}", error: "执行错误。", failed: "{time}\n获取失败({data})。" } }, randomba: { description: "随机BA图。", messages: { msg: "{quote}{image}", wait: "{quote}{time}\n请等待图片上传(可能较慢)。" } },
|
|
37
|
+
module2.exports = { commands: { cxgame: { description: "查询服务器当前人数。", messages: { msg: "{time}{list}\n进服指南请在群公告中查看。", list: "【MC 服务器 {count}】\n➣ {version}:{players}\n➣ 玩家列表:{list}\n➣ 备注:{note}", listNoPlayer: "【MC 服务器 {count}】\n➣ {version}:{players}\n➣ 备注:{note}", listFailed: "【MC 服务器 {count}】\n➣ 查询失败:{data}\n➣ 请稍后重试。\n➣ 备注:{note}", listA2S: "【A2S 服务器 {count}】\n➣ {version}:{players}\n➣ 机器人:{bots}\n➣ 备注:{note}", listFailedA2S: "【A2S 服务器 {count}】\n➣ 查询失败:{data}\n➣ 请稍后重试。\n➣ 备注:{note}", forbidden: "{time}\n此指令不允许在本群使用。", failed: "{time}\n查询失败:{data}", timeout: "请求超时。", timeout2: "响应超时。", fewData: "服务端返回的数据过少。", close: "服务器已关闭。", error: "执行错误。", host: "没有到主机的路由。" } }, status: { description: "查询机器人状态。", messages: { msg: "{time}\n--- 系统状态 ---\n系统名称:{name}\nCPU使用率:{cpu}\n内存使用率:{memory}\n--- 机器人状态 ---\n昨日收/发消息数量:{msgCount}\n机器人版本:{version}\n运行时间:{online}", failed: "{time}\n状态获取失败。" } }, random: { description: "随机数生成器。", usage: "缺少参数时默认生成 0-10000 的随机数。\n使用示例:", examples: "random 1 128 生成1到128范围的随机数", messages: { msg: "{time}\n生成的随机数:{data}" } }, info: { description: "查询机器人信息。", messages: { msg: "{data}", failed: "{time}\n读取信息失败。" } }, rw: { description: "随机名言名句。", messages: { msg: "{time}\n{data}", error: "执行错误。", failed: "{time}\n获取失败({data})。" } }, randomba: { description: "随机BA图。", messages: { msg: "{quote}{image}", wait: "{quote}{time}\n请等待图片上传(可能较慢)。" } }, centerservertest: { description: "查看中心服务器状态。", messages: { msg: "{time}{list}", list: "== {name} ==\n状态:{status}\n存活率:{uptime}\n检测时间:{time}", listFailed: "== {name} ==\n查看失败:{data}", failed: "{time}\n查看失败:{data}" } }, meme: { description: "群友的怪话!", messages: { msg: "{quote}{time}\n{image}\n{title}", failed: "{quote}{time}\n获取失败:{data}", forbidden: "{quote}{time}\n此指令不允许在本群使用。", error: "执行错误。" } }, randomcat: { description: "随机猫猫图。", messages: { msg: "{quote}{image}", wait: "{quote}{time}\n请等待图片上传(可能较慢)。", failed: "{quote}{time}\n获取失败:{data}" } }, getqqinfo: { description: "获取 QQ 号的信息。", messages: { msg: "{quote}{image}", failed: "{quote}{time}\n获取失败:{data}", command: "QQ 号不正确。" } }, msg2img: { description: "引用一个消息并使用此指令,即可将消息转图。", messages: { msg: "{quote}{image}", failed: "{quote}{time}\n获取失败:{data}", null: "未引用任何消息。", matroska: "{quote}禁止套娃!" } }, slnews: { description: "抓取 NorthWood 的 Steam 最新新闻。" } } };
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -56,10 +56,9 @@ var import_koishi2 = require("koishi");
|
|
|
56
56
|
// src/fun.ts
|
|
57
57
|
var import_os = __toESM(require("os"));
|
|
58
58
|
var import_fs = __toESM(require("fs"));
|
|
59
|
-
var import_ping = __toESM(require("ping"));
|
|
60
|
-
var import_steam_server_query = require("steam-server-query");
|
|
61
59
|
var import_path = __toESM(require("path"));
|
|
62
60
|
var import_koishi = require("koishi");
|
|
61
|
+
var import_steam_server_query = require("steam-server-query");
|
|
63
62
|
var import_html = __toESM(require("@bbob/html"));
|
|
64
63
|
var import_preset_html5 = __toESM(require("@bbob/preset-html5"));
|
|
65
64
|
function getSystemName() {
|
|
@@ -96,21 +95,19 @@ async function getCpuUsage() {
|
|
|
96
95
|
}
|
|
97
96
|
__name(getCpuUsage, "getCpuUsage");
|
|
98
97
|
async function getSystemUsage() {
|
|
99
|
-
let info;
|
|
100
98
|
try {
|
|
101
|
-
|
|
99
|
+
return {
|
|
102
100
|
"name": getSystemName(),
|
|
103
101
|
"cpu": await getCpuUsage() + "%",
|
|
104
102
|
"memory": getMemoryUsage() + "%",
|
|
105
103
|
"success": 0
|
|
106
104
|
};
|
|
107
105
|
} catch (error) {
|
|
108
|
-
|
|
106
|
+
return {
|
|
109
107
|
"data": error.message,
|
|
110
108
|
"success": 1
|
|
111
109
|
};
|
|
112
110
|
}
|
|
113
|
-
return info;
|
|
114
111
|
}
|
|
115
112
|
__name(getSystemUsage, "getSystemUsage");
|
|
116
113
|
function getHongKongTime() {
|
|
@@ -161,7 +158,6 @@ function formatTimestampDiff(start, end) {
|
|
|
161
158
|
__name(formatTimestampDiff, "formatTimestampDiff");
|
|
162
159
|
async function getMsgCount(ctx) {
|
|
163
160
|
const array = await ctx.database.get("analytics.message", { date: import_koishi.Time.getDateNumber() - 1 }, ["type", "count"]);
|
|
164
|
-
ctx.logger.info(import_koishi.Time.getDateNumber() - 1);
|
|
165
161
|
let receive = 0;
|
|
166
162
|
let send = 0;
|
|
167
163
|
array.forEach((item) => {
|
|
@@ -174,25 +170,6 @@ async function getMsgCount(ctx) {
|
|
|
174
170
|
return { "receive": receive, "send": send };
|
|
175
171
|
}
|
|
176
172
|
__name(getMsgCount, "getMsgCount");
|
|
177
|
-
async function hostPing(host) {
|
|
178
|
-
try {
|
|
179
|
-
const tmp = await import_ping.default.promise.probe(host, {
|
|
180
|
-
timeout: 5
|
|
181
|
-
});
|
|
182
|
-
return {
|
|
183
|
-
"success": true,
|
|
184
|
-
"ip": tmp.numeric_host,
|
|
185
|
-
"alive": tmp.alive,
|
|
186
|
-
"packetLoss": tmp.packetLoss.toString()
|
|
187
|
-
};
|
|
188
|
-
} catch (error) {
|
|
189
|
-
return {
|
|
190
|
-
"success": false,
|
|
191
|
-
"data": error.message
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
__name(hostPing, "hostPing");
|
|
196
173
|
function random(type = 0, data, data2) {
|
|
197
174
|
const random2 = new import_koishi.Random(() => Math.random());
|
|
198
175
|
switch (type) {
|
|
@@ -589,43 +566,66 @@ async function getBlueArchive(ctx, session) {
|
|
|
589
566
|
return 0;
|
|
590
567
|
}
|
|
591
568
|
__name(getBlueArchive, "getBlueArchive");
|
|
592
|
-
async function
|
|
593
|
-
const log = ctx.logger("
|
|
569
|
+
async function centerServerTest(ctx, session) {
|
|
570
|
+
const log = ctx.logger("centerServerTest");
|
|
594
571
|
log.debug(`Got: {"form":"${session.platform}:${session.event.guild?.id}","user":"${session.event.user?.id}","timestamp":${session.event.timestamp},"messageId":"${session.event.message?.id}"}`);
|
|
595
572
|
const time = getHongKongTime();
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
573
|
+
let msg;
|
|
574
|
+
let list = "";
|
|
575
|
+
const timeFormatter = new Intl.DateTimeFormat("zh-CN", {
|
|
576
|
+
timeZone: "Asia/Shanghai",
|
|
577
|
+
year: "numeric",
|
|
578
|
+
month: "2-digit",
|
|
579
|
+
day: "2-digit",
|
|
580
|
+
hour: "2-digit",
|
|
581
|
+
minute: "2-digit",
|
|
582
|
+
second: "2-digit",
|
|
583
|
+
hour12: false
|
|
584
|
+
});
|
|
585
|
+
const response = await request("https://status.scpslgame.com/api/status-page/heartbeat/nw", {}, ctx.config.timeout, log);
|
|
586
|
+
if (response.success) {
|
|
587
|
+
for (const server of ctx.config.slTest) {
|
|
588
|
+
const lastTime = response.data.heartbeatList[server.id].at(-1);
|
|
589
|
+
if (lastTime) {
|
|
590
|
+
const uptime24 = (response.data.uptimeList[server.id + "_24"] * 100).toFixed(2) + "%";
|
|
591
|
+
const status = lastTime?.status == 1 ? "正常" : "故障";
|
|
592
|
+
const testTime = timeFormatter.format(/* @__PURE__ */ new Date(lastTime?.time.replace(" ", "T") + "Z"));
|
|
593
|
+
list = list + "\n" + session.text(".list", {
|
|
594
|
+
"name": server.name,
|
|
595
|
+
"status": status,
|
|
596
|
+
"uptime": uptime24,
|
|
597
|
+
"time": testTime
|
|
598
|
+
});
|
|
599
|
+
} else {
|
|
600
|
+
list = list + "\n" + session.text(".listFailed", {
|
|
601
|
+
"name": server.name,
|
|
602
|
+
"data": "未能获取到此服务器的状态信息。"
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
msg = {
|
|
607
|
+
"data": { "list": list, "time": time },
|
|
608
|
+
"success": ".msg"
|
|
610
609
|
};
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
"data":
|
|
610
|
+
log.debug("Sent:");
|
|
611
|
+
log.debug(msg);
|
|
612
|
+
} else {
|
|
613
|
+
let err;
|
|
614
|
+
if (response.code) {
|
|
615
|
+
err = response.isJson ? response.error["data"] : response.error;
|
|
616
|
+
} else {
|
|
617
|
+
err = response.error.message;
|
|
618
|
+
}
|
|
619
|
+
msg = {
|
|
620
|
+
"data": { "data": err, "time": time },
|
|
621
|
+
"success": ".failed"
|
|
617
622
|
};
|
|
623
|
+
log.warn("Sent:");
|
|
624
|
+
log.warn(msg);
|
|
618
625
|
}
|
|
619
|
-
return
|
|
620
|
-
"success": 0,
|
|
621
|
-
"time": time,
|
|
622
|
-
"host": host,
|
|
623
|
-
"ip": tmp.ip,
|
|
624
|
-
"alive": tmp.alive == true ? "正常" : "异常",
|
|
625
|
-
"packetLoss": tmp.packetLoss
|
|
626
|
-
};
|
|
626
|
+
return msg;
|
|
627
627
|
}
|
|
628
|
-
__name(
|
|
628
|
+
__name(centerServerTest, "centerServerTest");
|
|
629
629
|
async function getMeme(ctx, session, count) {
|
|
630
630
|
const log = ctx.logger("getMeme");
|
|
631
631
|
log.debug(`Got: {"form":"${session.platform}:${session.event.guild?.id}","user":"${session.event.user?.id}","timestamp":${session.event.timestamp},"messageId":"${session.event.message?.id}"}`);
|
|
@@ -814,7 +814,7 @@ async function getMsg(ctx, session) {
|
|
|
814
814
|
__name(getMsg, "getMsg");
|
|
815
815
|
async function getNewsMsg(ctx, type) {
|
|
816
816
|
const log = ctx.logger("getNewsMsg");
|
|
817
|
-
const response = await request("
|
|
817
|
+
const response = await request("https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/?appid=700330&count=1", {}, ctx.config.timeout, log);
|
|
818
818
|
if (response.success) {
|
|
819
819
|
if ((await ctx.database.get("botData", "newsId"))[0]?.data == response.data.appnews.newsitems[0].gid && type != 1) {
|
|
820
820
|
log.debug("无新闻");
|
|
@@ -857,7 +857,7 @@ async function getNewsMsg(ctx, type) {
|
|
|
857
857
|
__name(getNewsMsg, "getNewsMsg");
|
|
858
858
|
|
|
859
859
|
// package.json
|
|
860
|
-
var version = "2.
|
|
860
|
+
var version = "2.23.0";
|
|
861
861
|
|
|
862
862
|
// src/index.ts
|
|
863
863
|
var inject = ["database", "installer", "puppeteer", "cron"];
|
|
@@ -887,9 +887,6 @@ var Config = import_koishi3.Schema.intersect([
|
|
|
887
887
|
import_koishi3.Schema.object({
|
|
888
888
|
baAPI: import_koishi3.Schema.array(String).default(["https://rba.kanostar.top/portrait"]).description("随机BA图 API")
|
|
889
889
|
}).description("随机BA图"),
|
|
890
|
-
import_koishi3.Schema.object({
|
|
891
|
-
serverPing: import_koishi3.Schema.dict(String).role("table").description("键:群号;值:Host")
|
|
892
|
-
}).description("服之测测(Ping)"),
|
|
893
890
|
import_koishi3.Schema.object({
|
|
894
891
|
steamAPI: import_koishi3.Schema.string().default("https://api.tasaed.top/get/steamid/").description("转换 Steam ID API")
|
|
895
892
|
}).description("转换 Steam ID"),
|
|
@@ -904,7 +901,13 @@ var Config = import_koishi3.Schema.intersect([
|
|
|
904
901
|
}).description("获取 QQ 信息"),
|
|
905
902
|
import_koishi3.Schema.object({
|
|
906
903
|
slNews: import_koishi3.Schema.array(String).default([""]).description("{platform}:{channelId}")
|
|
907
|
-
}).description("SL新闻列表")
|
|
904
|
+
}).description("SL新闻列表"),
|
|
905
|
+
import_koishi3.Schema.object({
|
|
906
|
+
slTest: import_koishi3.Schema.array(import_koishi3.Schema.object({
|
|
907
|
+
id: import_koishi3.Schema.string().description("服务器 ID"),
|
|
908
|
+
name: import_koishi3.Schema.string().description("服务器 名称")
|
|
909
|
+
})).default([{ "id": "1", "name": "中心 鲁贝 1" }, { "id": "19", "name": "中心 斯特拉斯堡 1" }, { "id": "3", "name": "Steam 认证 API" }]).description("测试中心服务器")
|
|
910
|
+
}).description("测试中心服务器")
|
|
908
911
|
]).description("基础设置");
|
|
909
912
|
function apply(ctx) {
|
|
910
913
|
ctx.i18n.define("zh-CN", require_zh_CN());
|
|
@@ -920,7 +923,7 @@ function apply(ctx) {
|
|
|
920
923
|
{ id: "version", data: version }
|
|
921
924
|
]);
|
|
922
925
|
});
|
|
923
|
-
ctx.command("slnews"
|
|
926
|
+
ctx.command("slnews").action(async () => {
|
|
924
927
|
const outMsg = await getNewsMsg(ctx, 1);
|
|
925
928
|
if (outMsg.success) {
|
|
926
929
|
return `${outMsg.msg}
|
|
@@ -933,7 +936,7 @@ ${(0, import_koishi3.h)("image", { url: `data:image/jpg;base64,${outMsg.data}` }
|
|
|
933
936
|
ctx.cron("0 * * * *", async () => {
|
|
934
937
|
ctx.emit("node-async/news");
|
|
935
938
|
});
|
|
936
|
-
ctx.cron("
|
|
939
|
+
ctx.cron("30 * * * *", async () => {
|
|
937
940
|
ctx.emit("node-async/news");
|
|
938
941
|
});
|
|
939
942
|
ctx.on("node-async/news", async () => {
|
|
@@ -987,15 +990,9 @@ ${(0, import_koishi3.h)("image", { url: `data:image/jpg;base64,${outMsg.data}` }
|
|
|
987
990
|
ctx.command("randomBA").alias("随机ba图").action(async ({ session }) => {
|
|
988
991
|
await getBlueArchive(ctx, session);
|
|
989
992
|
});
|
|
990
|
-
ctx.command("
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
return session?.text(".msg", server);
|
|
994
|
-
} else if (server["success"] == 1) {
|
|
995
|
-
return session?.text(".forbidden", server);
|
|
996
|
-
} else {
|
|
997
|
-
return session?.text(".failed", server);
|
|
998
|
-
}
|
|
993
|
+
ctx.command("centerServerTest").alias("测测中心服务器").action(async ({ session }) => {
|
|
994
|
+
const msg = await centerServerTest(ctx, session);
|
|
995
|
+
return session?.text(msg.success, msg.data);
|
|
999
996
|
});
|
|
1000
997
|
ctx.command("meme [序号:posint]").alias("memes").action(async ({ session }, count) => {
|
|
1001
998
|
await getMeme(ctx, session, count);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-node-async-bot-all",
|
|
3
3
|
"description": "NodeAsync Bot插件(自用)",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.23.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"contributors": [
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@bbob/html": "^4.3.1",
|
|
42
42
|
"@bbob/preset-html5": "^4.3.1",
|
|
43
|
-
"ping": "^1.0.0",
|
|
44
43
|
"steam-server-query": "^1.1.3"
|
|
45
44
|
}
|
|
46
45
|
}
|