beatsaber-bot-core 0.2.0-dev.1 → 0.2.0-dev.10
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/api/base/blRequset.js +7 -7
- package/lib/api/base/blRequset.js.map +1 -1
- package/lib/api/composed/beatleader.d.ts +5 -0
- package/lib/api/composed/beatleader.js +22 -1
- package/lib/api/composed/beatleader.js.map +1 -1
- package/lib/api/interfaces/beatsaver/ws.d.ts +8 -2
- package/lib/cmd/bind/bind-beatleader.js.map +1 -1
- package/lib/cmd/bind/bind-beatsaver.js.map +1 -1
- package/lib/cmd/bind/bind-id-beatleader.js.map +1 -1
- package/lib/cmd/bind/bind-scoresaber.js.map +1 -1
- package/lib/cmd/bind/index.d.ts +2 -2
- package/lib/cmd/bsmap/id-search.d.ts +1 -1
- package/lib/cmd/bsmap/id-search.js +1 -1
- package/lib/cmd/bsmap/id-search.js.map +1 -1
- package/lib/cmd/bsmap/key-search.d.ts +1 -1
- package/lib/cmd/bsmap/latest.d.ts +1 -1
- package/lib/cmd/builder.d.ts +2 -2
- package/lib/cmd/builder.js +20 -1
- package/lib/cmd/builder.js.map +1 -1
- package/lib/cmd/deprecated/cmp.d.ts +1 -1
- package/lib/cmd/deprecated/me.d.ts +2 -2
- package/lib/cmd/deprecated/tmp.d.ts +1 -1
- package/lib/cmd/deprecated/whois.d.ts +2 -2
- package/lib/cmd/help.d.ts +1 -1
- package/lib/cmd/rank.d.ts +2 -2
- package/lib/cmd/rank.js +4 -2
- package/lib/cmd/rank.js.map +1 -1
- package/lib/cmd/score.d.ts +2 -2
- package/lib/cmd/subscribe/index.d.ts +2 -2
- package/lib/cmd/subscribe/subjoin.d.ts +2 -2
- package/lib/cmd/subscribe/subleave.d.ts +2 -2
- package/lib/cmd/subscribe/unsubscribe.d.ts +2 -2
- package/lib/db/index.d.ts +0 -34
- package/lib/db/index.js +0 -2
- package/lib/errors/index.d.ts +25 -41
- package/lib/errors/index.js +54 -59
- package/lib/errors/index.js.map +1 -1
- package/lib/img-render/components/RankDifficulty.d.ts +5 -0
- package/lib/img-render/components/RankDifficulty.js +11 -0
- package/lib/img-render/components/RankDifficulty.js.map +1 -0
- package/lib/img-render/components/base/avatar.d.ts +7 -0
- package/lib/img-render/components/base/avatar.js +11 -0
- package/lib/img-render/components/base/avatar.js.map +1 -1
- package/lib/img-render/components/rankScoreItem.d.ts +15 -0
- package/lib/img-render/components/rankScoreItem.js +38 -0
- package/lib/img-render/components/rankScoreItem.js.map +1 -0
- package/lib/img-render/components/scoregraph.d.ts +3 -1
- package/lib/img-render/components/scoregraph.js +5 -4
- package/lib/img-render/components/scoregraph.js.map +1 -1
- package/lib/img-render/index.js +6 -2
- package/lib/img-render/index.js.map +1 -1
- package/lib/img-render/render.js +26 -1
- package/lib/img-render/render.js.map +1 -1
- package/lib/img-render/result/bl-score.js +1 -1
- package/lib/img-render/result/bl-score.js.map +1 -1
- package/lib/img-render/result/bs-score-with-rank.d.ts +13 -0
- package/lib/img-render/result/bs-score-with-rank.js +21 -0
- package/lib/img-render/result/bs-score-with-rank.js.map +1 -0
- package/lib/img-render/result/index.d.ts +1 -0
- package/lib/img-render/result/index.js +6 -1
- package/lib/img-render/result/index.js.map +1 -1
- package/lib/img-render/utils/format.d.ts +2 -0
- package/lib/img-render/utils/format.js +11 -1
- package/lib/img-render/utils/format.js.map +1 -1
- package/lib/img-render/utils/index.d.ts +1 -1
- package/lib/img-render/utils/index.js +1 -1
- package/lib/img-render/utils/index.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interface/bot.d.ts +1 -1
- package/lib/interface/{db.d.ts → db/index.d.ts} +2 -2
- package/lib/interface/db/index.js +18 -0
- package/lib/interface/db/index.js.map +1 -0
- package/lib/interface/db/models.d.ts +34 -0
- package/lib/interface/{db.js → db/models.js} +1 -1
- package/lib/interface/db/models.js.map +1 -0
- package/lib/interface/index.d.ts +0 -1
- package/lib/interface/index.js +0 -1
- package/lib/interface/index.js.map +1 -1
- package/lib/schedules/index.d.ts +3 -2
- package/lib/schedules/index.js +13 -16
- package/lib/schedules/index.js.map +1 -1
- package/lib/schedules/interface.d.ts +17 -0
- package/lib/schedules/interface.js +3 -0
- package/lib/schedules/interface.js.map +1 -0
- package/lib/schedules/oauthTokenRefreshTask.d.ts +2 -5
- package/lib/schedules/oauthTokenRefreshTask.js +9 -9
- package/lib/schedules/oauthTokenRefreshTask.js.map +1 -1
- package/lib/schedules/temp.d.ts +1 -5
- package/lib/schedules/temp.js +25 -20
- package/lib/schedules/temp.js.map +1 -1
- package/lib/utils/cache.d.ts +2 -0
- package/lib/utils/cache.js +28 -0
- package/lib/utils/cache.js.map +1 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.js +77 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/ws/beatleader.js +1 -0
- package/lib/ws/beatleader.js.map +1 -1
- package/lib/ws/beatsaver.d.ts +6 -1
- package/lib/ws/beatsaver.js +28 -26
- package/lib/ws/beatsaver.js.map +1 -1
- package/package.json +2 -1
- package/lib/cmd/decrepeted/cmp.d.ts +0 -9
- package/lib/cmd/decrepeted/cmp.js +0 -15
- package/lib/cmd/decrepeted/cmp.js.map +0 -1
- package/lib/cmd/decrepeted/me.d.ts +0 -13
- package/lib/cmd/decrepeted/me.js +0 -66
- package/lib/cmd/decrepeted/me.js.map +0 -1
- package/lib/cmd/decrepeted/tmp.d.ts +0 -9
- package/lib/cmd/decrepeted/tmp.js +0 -21
- package/lib/cmd/decrepeted/tmp.js.map +0 -1
- package/lib/cmd/decrepeted/whois.d.ts +0 -11
- package/lib/cmd/decrepeted/whois.js +0 -40
- package/lib/cmd/decrepeted/whois.js.map +0 -1
- package/lib/cmd/subscribe/alert.d.ts +0 -0
- package/lib/cmd/subscribe/alert.js +0 -86
- package/lib/cmd/subscribe/alert.js.map +0 -1
- package/lib/cmd/subscribe/blfilters.d.ts +0 -0
- package/lib/cmd/subscribe/blfilters.js +0 -49
- package/lib/cmd/subscribe/blfilters.js.map +0 -1
- package/lib/cmd/subscribe/scoresaber.d.ts +0 -0
- package/lib/cmd/subscribe/scoresaber.js +0 -43
- package/lib/cmd/subscribe/scoresaber.js.map +0 -1
- package/lib/interface/db.js.map +0 -1
- package/lib/interface/tables.d.ts +0 -0
- package/lib/interface/tables.js +0 -1
- package/lib/interface/tables.js.map +0 -1
- package/lib/utils.d.ts +0 -2
- package/lib/utils.js +0 -25
- package/lib/utils.js.map +0 -1
package/lib/ws/beatsaver.d.ts
CHANGED
@@ -3,6 +3,7 @@ import { Logger } from '../interface/logger';
|
|
3
3
|
import { RenderService } from '../img-render';
|
4
4
|
import { Config } from '../config';
|
5
5
|
import { DB } from '../interface/db';
|
6
|
+
import { BeatSaverWSEvent } from '../api/interfaces/beatsaver';
|
6
7
|
import { BotService, Session } from '../interface';
|
7
8
|
export declare class BeatSaverWSHandler<T> implements WSHandler {
|
8
9
|
private readonly logger;
|
@@ -14,5 +15,9 @@ export declare class BeatSaverWSHandler<T> implements WSHandler {
|
|
14
15
|
constructor(db: DB<T>, render: RenderService, logger: Logger, config: Config, botService: BotService<T, Session<T>>);
|
15
16
|
onOpen(): void;
|
16
17
|
onClose(): void;
|
17
|
-
|
18
|
+
eventParser(event: any): BeatSaverWSEvent;
|
19
|
+
eventFilter: (data: BeatSaverWSEvent) => boolean;
|
20
|
+
eventIdSelector: (data: BeatSaverWSEvent) => string;
|
21
|
+
BSWSHandler(data: BeatSaverWSEvent): Promise<void>;
|
22
|
+
onEvent: (event: any) => Promise<void>;
|
18
23
|
}
|
package/lib/ws/beatsaver.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.BeatSaverWSHandler = void 0;
|
4
|
+
const utils_1 = require("../utils");
|
4
5
|
class BeatSaverWSHandler {
|
5
6
|
logger;
|
6
7
|
render;
|
@@ -21,36 +22,37 @@ class BeatSaverWSHandler {
|
|
21
22
|
onClose() {
|
22
23
|
this.logger.info('BeatsaverWS closed');
|
23
24
|
}
|
24
|
-
|
25
|
-
|
25
|
+
eventParser(event) {
|
26
|
+
return JSON.parse(event.toString());
|
27
|
+
}
|
28
|
+
eventFilter = (data) => {
|
29
|
+
return (data.type === 'MAP_UPDATE' &&
|
30
|
+
data.msg.versions.some((it) => it.state == 'Published') &&
|
31
|
+
data.msg.declaredAi === 'None');
|
32
|
+
};
|
33
|
+
eventIdSelector = (data) => `ws.bs.${data.type === 'MAP_DELETE' ? data.msg : data.msg.id}.${data.type}`;
|
34
|
+
async BSWSHandler(data) {
|
26
35
|
// this.logger.info('Beatsaver message received', data.type, data?.msg?.id)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
const
|
37
|
-
|
38
|
-
|
39
|
-
if (restSub.length === 0)
|
40
|
-
return;
|
41
|
-
const image = this.render.renderMap(bsmap);
|
42
|
-
for (const item of restSub) {
|
43
|
-
const session = this.botService.getSessionByChannelInfo(item.groupChannel);
|
44
|
-
if (!session) {
|
45
|
-
continue;
|
46
|
-
}
|
47
|
-
await session.send(`本群谱师 「<at id="${item.account.uid}"/> (${bsmap.uploader.name})」刚刚发布了新谱面,「${bsmap.name}」`);
|
48
|
-
// text + mention element
|
49
|
-
await session.send(await image);
|
50
|
-
await session.sendAudioByUrl(bsmap.versions[0].previewURL);
|
36
|
+
const bsmap = data.msg;
|
37
|
+
const userId = bsmap.uploader.id;
|
38
|
+
const subscriptions = await this.db.getAllSubScriptionByUIDAndPlatform(userId, 'beatsaver');
|
39
|
+
const restSub = subscriptions.filter((it) => it.subscribe.type == 'beatsaver-map' && it.subscribe.enable == true);
|
40
|
+
// cacheService
|
41
|
+
if (restSub.length === 0)
|
42
|
+
return;
|
43
|
+
const image = this.render.renderMap(bsmap);
|
44
|
+
for (const item of restSub) {
|
45
|
+
const session = this.botService.getSessionByChannelInfo(item.groupChannel);
|
46
|
+
if (!session) {
|
47
|
+
continue;
|
51
48
|
}
|
49
|
+
await session.send(`本群谱师 「<at id="${item.account.uid}"/> (${bsmap.uploader.name})」刚刚发布了新谱面,「${bsmap.name}」`);
|
50
|
+
// text + mention element
|
51
|
+
await session.send(await image);
|
52
|
+
await session.sendAudioByUrl(bsmap.versions[0].previewURL);
|
52
53
|
}
|
53
54
|
}
|
55
|
+
onEvent = (0, utils_1.handleWSEventWithCache)(this, this.BSWSHandler, 1000 * 60 * 15, this.eventParser, this.eventFilter, this.eventIdSelector);
|
54
56
|
}
|
55
57
|
exports.BeatSaverWSHandler = BeatSaverWSHandler;
|
56
58
|
//# sourceMappingURL=beatsaver.js.map
|
package/lib/ws/beatsaver.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"beatsaver.js","sourceRoot":"","sources":["../../src/ws/beatsaver.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"beatsaver.js","sourceRoot":"","sources":["../../src/ws/beatsaver.ts"],"names":[],"mappings":";;;AAOA,mCAAuD;AAEvD,MAAa,kBAAkB;IACZ,MAAM,CAAQ;IACvB,MAAM,CAAe;IACrB,UAAU,CAA2B;IAC7C,KAAK,GAAW,6BAA6B,CAAA;IACrC,EAAE,CAAO;IACjB,MAAM,CAAQ;IACd,YACE,EAAS,EACT,MAAqB,EACrB,MAAc,EACd,MAAc,EACd,UAAqC;QAErC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;IACxC,CAAC;IAED,OAAO;QACL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CAAC,KAAK,CAAC,CAAA;QAC1C,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;YAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,SAAQ;YACV,CAAC;YACD,MAAM,OAAO,CAAC,IAAI,CAChB,iBAAiB,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,KAAK,CAAC,QAAQ,CAAC,IAAI,eAAe,KAAK,CAAC,IAAI,GAAG,CACzF,CAAA;YACD,yBAAyB;YACzB,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAA;YAC/B,MAAM,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,GAAG,IAAA,8BAAsB,EAC9B,IAAI,EACJ,IAAI,CAAC,WAAW,EAChB,IAAI,GAAG,EAAE,GAAG,EAAE,EACd,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,eAAe,CACrB,CAAA;CACF;AAjFD,gDAiFC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "beatsaber-bot-core",
|
3
3
|
"description": "一个用于新版 Steam 家庭的库存监控 Bot 插件",
|
4
|
-
"version": "0.2.0-dev.
|
4
|
+
"version": "0.2.0-dev.10",
|
5
5
|
"types": "lib/index.d.ts",
|
6
6
|
"files": [
|
7
7
|
"lib"
|
@@ -56,6 +56,7 @@
|
|
56
56
|
"chart.js": "^4.4.3",
|
57
57
|
"country-flag-icons": "^1.5.11",
|
58
58
|
"dayjs": "^1.11.3",
|
59
|
+
"lru-cache": "^11.0.1",
|
59
60
|
"lucide-react": "^0.379.0",
|
60
61
|
"react": "^18.3.1",
|
61
62
|
"react-dom": "^18.3.1"
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const builder_1 = require("../../cmd/builder");
|
4
|
-
exports.default = () => new builder_1.CommandBuilder()
|
5
|
-
.setName('cmp') // <mapId:string>
|
6
|
-
.addAlias('bbcmp')
|
7
|
-
// .shortcut(/(^[0-9a-fA-F]{3,5}$)/, { args: ['$1'] })
|
8
|
-
.setDescription('clear an auth account relate info')
|
9
|
-
.setExecutor(async (c) => {
|
10
|
-
// 1. @someone
|
11
|
-
// 2. mapId/Hash
|
12
|
-
// 3. me
|
13
|
-
c.session.send('still working on');
|
14
|
-
});
|
15
|
-
//# sourceMappingURL=cmp.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cmp.js","sourceRoot":"","sources":["../../../src/cmd/decrepeted/cmp.ts"],"names":[],"mappings":";;AAAA,2CAA8C;AAE9C,kBAAe,GAAG,EAAE,CAClB,IAAI,wBAAc,EAAE;KACjB,OAAO,CAAC,KAAK,CAAC,CAAC,iBAAiB;KAChC,QAAQ,CAAC,OAAO,CAAC;IAClB,sDAAsD;KACrD,cAAc,CAAC,mCAAmC,CAAC;KACnD,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;IACvB,cAAc;IACd,gBAAgB;IAChB,QAAQ;IACR,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;AACpC,CAAC,CAAC,CAAA"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
declare const _default: () => {
|
2
|
-
name: string;
|
3
|
-
description: string;
|
4
|
-
aliases: import("../../interface").CmdAlias[];
|
5
|
-
options: import("../../interface").CmdOption[];
|
6
|
-
callback: import("../../interface").CmdExecutor<unknown, {
|
7
|
-
d?: string;
|
8
|
-
m?: string;
|
9
|
-
p?: string;
|
10
|
-
}>;
|
11
|
-
children: any[];
|
12
|
-
};
|
13
|
-
export default _default;
|
package/lib/cmd/decrepeted/me.js
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const builder_1 = require("../../cmd/builder");
|
4
|
-
const interface_1 = require("../../interface");
|
5
|
-
const utils_1 = require("../../utils");
|
6
|
-
// todo
|
7
|
-
// this is a command for user that need to remove dirty data
|
8
|
-
exports.default = () => new builder_1.CommandBuilder()
|
9
|
-
// [mapId:string]
|
10
|
-
.setName('me')
|
11
|
-
.addOption('p', 'platform:string')
|
12
|
-
.addOption('d', 'difficulty:string')
|
13
|
-
.addOption('m', 'mode:string')
|
14
|
-
.setDescription('clear an auth account relate info')
|
15
|
-
.addAlias('bbme')
|
16
|
-
.addAlias('bbmess', { options: { p: 'ss' } })
|
17
|
-
.addAlias('bbmebl', { options: { p: 'bl' } })
|
18
|
-
.addAlias('ssme', { options: { p: 'ss' } })
|
19
|
-
.addAlias('blme', { options: { p: 'bl' } })
|
20
|
-
.addAlias('!ws', { options: { p: 'ss' } })
|
21
|
-
.addAlias('!wb', { options: { p: 'bl' } })
|
22
|
-
.addAlias('iws', { options: { p: 'ss' } })
|
23
|
-
.addAlias('iwb', { options: { p: 'bl' } })
|
24
|
-
.addAlias('!wss', { options: { p: 'ss' } })
|
25
|
-
.addAlias('!wbl', { options: { p: 'bl' } })
|
26
|
-
.addAlias('iwss', { options: { p: 'ss' } })
|
27
|
-
.addAlias('iwbl', { options: { p: 'bl' } })
|
28
|
-
.setExecutor(async (c) => {
|
29
|
-
const rankPlatform = c.options.p == 'ss' ? interface_1.Platform.SS : interface_1.Platform.BL;
|
30
|
-
const { blAccount, ssAccount } = await c.db.getUserAccountsByUid(c.session.u.id);
|
31
|
-
let accountId = interface_1.Platform.BL && blAccount.platformUid;
|
32
|
-
accountId ||= interface_1.Platform.SS && ssAccount.platformUid;
|
33
|
-
if (!accountId) {
|
34
|
-
c.session.sendQuote(c.session.text('commands.bsbot.me.not-found'));
|
35
|
-
return;
|
36
|
-
}
|
37
|
-
const onStartRender = () => {
|
38
|
-
c.session.send(c.session.text('common.render.wait', {
|
39
|
-
sec: c.config.rankWaitTimeout / 1000,
|
40
|
-
}));
|
41
|
-
};
|
42
|
-
if (c.input && c.input !== '') {
|
43
|
-
// todo improve diff opts
|
44
|
-
let diffOption;
|
45
|
-
if (c.options.d || c.options.m) {
|
46
|
-
diffOption = {
|
47
|
-
difficulty: (0, utils_1.convertDiff)(c.options.d),
|
48
|
-
mode: c.options.m,
|
49
|
-
};
|
50
|
-
}
|
51
|
-
const scoreReq = await c.api.BeatLeader.wrapperResult().getScoreByPlayerIdAndMapId(accountId, c.input, diffOption);
|
52
|
-
if (!scoreReq.isSuccess()) {
|
53
|
-
c.session.sendQuote(c.session.text('commands.bsbot.me.score-not-found', {
|
54
|
-
user: accountId,
|
55
|
-
id: c.input,
|
56
|
-
}));
|
57
|
-
return;
|
58
|
-
}
|
59
|
-
const img = await c.render.renderScore(scoreReq.data.id.toString(), rankPlatform);
|
60
|
-
c.session.sendQueued(img);
|
61
|
-
return;
|
62
|
-
}
|
63
|
-
const img = await c.render.renderRank(accountId, rankPlatform);
|
64
|
-
c.session.sendQueued(img);
|
65
|
-
});
|
66
|
-
//# sourceMappingURL=me.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"me.js","sourceRoot":"","sources":["../../../src/cmd/decrepeted/me.ts"],"names":[],"mappings":";;AAAA,2CAA8C;AAC9C,2CAAsC;AACtC,mCAAqC;AAErC,OAAO;AACP,6DAA6D;AAC7D,kBAAe,GAAG,EAAE,CAClB,IAAI,wBAAc,EAAE;IAClB,iBAAiB;KAChB,OAAO,CAAC,IAAI,CAAC;KACb,SAAS,CAAC,GAAG,EAAE,iBAAiB,CAAC;KACjC,SAAS,CAAC,GAAG,EAAE,mBAAmB,CAAC;KACnC,SAAS,CAAC,GAAG,EAAE,aAAa,CAAC;KAC7B,cAAc,CAAC,mCAAmC,CAAC;KACnD,QAAQ,CAAC,M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D,SAAS,EACT,CAAC,CAAC,KAAK,EACP,UAAU,CACX,CAAA;QACH,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;YAC1B,CAAC,CAAC,OAAO,CAAC,SAAS,CACjB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE;gBAClD,IAAI,EAAE,SAAS;gBACf,EAAE,EAAE,CAAC,CAAC,KAAK;aACZ,CAAC,CACH,CAAA;YACD,OAAM;QACR,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,EAC3B,YAAY,CACb,CAAA;QACD,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QACzB,OAAM;IACR,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;IAC9D,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC,CAAC,CAAA"}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const builder_1 = require("../../cmd/builder");
|
4
|
-
exports.default = () => new builder_1.CommandBuilder()
|
5
|
-
.setName('lb')
|
6
|
-
.addAlias('/lb')
|
7
|
-
.setDescription('clear an auth account relate info')
|
8
|
-
.addAlias('bblb')
|
9
|
-
.setExecutor(async (c) => {
|
10
|
-
const [hit, score] = await Promise.all([
|
11
|
-
c.render.renderUrl('https://aiobs.ktlab.io/tmp/lb/hitcnt', () => {
|
12
|
-
c.session.sendQueued('开始渲染砍击榜了,请耐心等待 10s');
|
13
|
-
}),
|
14
|
-
c.render.renderUrl('https://aiobs.ktlab.io/tmp/lb/score', () => {
|
15
|
-
c.session.sendQueued('开始渲染分数榜了,请耐心等待 10s');
|
16
|
-
}),
|
17
|
-
]);
|
18
|
-
c.session.sendImgBuffer(hit, 'image/png');
|
19
|
-
c.session.sendImgBuffer(score, 'image/png');
|
20
|
-
});
|
21
|
-
//# sourceMappingURL=tmp.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"tmp.js","sourceRoot":"","sources":["../../../src/cmd/decrepeted/tmp.ts"],"names":[],"mappings":";;AAAA,2CAA8C;AAE9C,kBAAe,GAAG,EAAE,CAClB,IAAI,wBAAc,EAAE;KACjB,OAAO,CAAC,IAAI,CAAC;KACb,QAAQ,CAAC,KAAK,CAAC;KAEf,cAAc,CAAC,mCAAmC,CAAC;KACnD,QAAQ,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;IACvB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACrC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9D,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;QAC5C,CAAC,CAAC;QACF,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC7D,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;QAC5C,CAAC,CAAC;KACH,CAAC,CAAA;IACF,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;IACzC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;AAC7C,CAAC,CAAC,CAAA"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
declare const _default: () => {
|
2
|
-
name: string;
|
3
|
-
description: string;
|
4
|
-
aliases: import("../../interface").CmdAlias[];
|
5
|
-
options: import("../../interface").CmdOption[];
|
6
|
-
callback: import("../../interface").CmdExecutor<unknown, {
|
7
|
-
p?: string;
|
8
|
-
}>;
|
9
|
-
children: any[];
|
10
|
-
};
|
11
|
-
export default _default;
|
@@ -1,40 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const builder_1 = require("../../cmd/builder");
|
4
|
-
const interface_1 = require("../../interface");
|
5
|
-
exports.default = () => new builder_1.CommandBuilder()
|
6
|
-
.setName('who')
|
7
|
-
.addOption('p', 'platform:string')
|
8
|
-
.setDescription('clear an auth account relate info')
|
9
|
-
.addAlias('bbwho')
|
10
|
-
.addAlias('bbwhoss', { options: { p: 'ss' } })
|
11
|
-
.addAlias('bbwhobl', { options: { p: 'bl' } })
|
12
|
-
.addAlias('sswho', { options: { p: 'ss' } })
|
13
|
-
.addAlias('blwho', { options: { p: 'bl' } })
|
14
|
-
.addAlias('!whos', { options: { p: 'ss' } })
|
15
|
-
.addAlias('!whob', { options: { p: 'bl' } })
|
16
|
-
.addAlias('iwhos', { options: { p: 'ss' } })
|
17
|
-
.addAlias('iwhob', { options: { p: 'bl' } })
|
18
|
-
.setExecutor(async (c) => {
|
19
|
-
const rankPlatform = c.options.p == 'ss' ? interface_1.Platform.SS : interface_1.Platform.BL;
|
20
|
-
const uid = c.session.mentions?.[0];
|
21
|
-
if (!uid) {
|
22
|
-
c.session.sendQuote(c.session.text('commands.bsbot.who.need-at'));
|
23
|
-
return;
|
24
|
-
}
|
25
|
-
const { blAccount, ssAccount } = await c.db.getUserAccountsByUid(uid);
|
26
|
-
let accountId = interface_1.Platform.BL && blAccount.platformUid;
|
27
|
-
accountId ||= interface_1.Platform.SS && ssAccount.platformUid;
|
28
|
-
if (!accountId) {
|
29
|
-
c.session.sendQuote(c.session.text('commands.bsbot.who.not-found'));
|
30
|
-
return;
|
31
|
-
}
|
32
|
-
const onStartRender = () => {
|
33
|
-
c.session.send(c.session.text('common.render.wait', {
|
34
|
-
sec: c.config.rankWaitTimeout / 1000,
|
35
|
-
}));
|
36
|
-
};
|
37
|
-
const img = await c.render.renderRank(accountId, rankPlatform);
|
38
|
-
c.session.sendQueued(img);
|
39
|
-
});
|
40
|
-
//# sourceMappingURL=whois.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"whois.js","sourceRoot":"","sources":["../../../src/cmd/decrepeted/whois.ts"],"names":[],"mappings":";;AAAA,2CAA8C;AAC9C,2CAAsC;AAEtC,kBAAe,GAAG,EAAE,CAClB,IAAI,wBAAc,EAAE;KACjB,OAAO,CAAC,KAAK,CAAC;KACd,SAAS,CAAC,GAAG,EAAE,iBAAiB,CAAC;KACjC,cAAc,CAAC,mCAAmC,CAAC;KACnD,QAAQ,CAAC,OAAO,CAAC;KACjB,QAAQ,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC7C,QAAQ,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC7C,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC3C,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC3C,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC3C,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC3C,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC3C,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;KAC3C,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,EA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changes
|
@@ -1,86 +0,0 @@
|
|
1
|
-
// import { APIService } from '../../service'
|
2
|
-
//
|
3
|
-
// export const alert = async (
|
4
|
-
// ctx: Context,
|
5
|
-
// api: APIService,
|
6
|
-
// { session, options },
|
7
|
-
// input,
|
8
|
-
// logger: Logger
|
9
|
-
// ) => {
|
10
|
-
// const res = await ctx.database.get('BSRelateOAuthAccount', {
|
11
|
-
// uid: session.user.id,
|
12
|
-
// platform: 'beatsaver',
|
13
|
-
// type: 'oauth',
|
14
|
-
// valid: 'ok',
|
15
|
-
// })
|
16
|
-
// if (res.length < 1) {
|
17
|
-
// session.sendQueued(
|
18
|
-
// h('message', [
|
19
|
-
// h(
|
20
|
-
// 'quote',
|
21
|
-
// { messageId: session.messageId },
|
22
|
-
// session.text('commands.bsbot.subscribe.alert.no-bind-bs-id')
|
23
|
-
// ),
|
24
|
-
// ])
|
25
|
-
// )
|
26
|
-
// return
|
27
|
-
// }
|
28
|
-
// const dbAccount = res[0]
|
29
|
-
// let alerts = await api.BeatSaver.withRetry(3)
|
30
|
-
// .wrapperResult()
|
31
|
-
// .getUnreadAlertsByPage(dbAccount.accessToken, 0)
|
32
|
-
// if (!alerts.isSuccess()) {
|
33
|
-
// logger.info('accessToken invalid, try to refresh')
|
34
|
-
// const token = await api.BeatSaver.wrapperResult().refreshOAuthToken(
|
35
|
-
// dbAccount.refreshToken
|
36
|
-
// )
|
37
|
-
// const now = new Date()
|
38
|
-
// if (!token.isSuccess()) {
|
39
|
-
// logger.info(
|
40
|
-
// `failed to refresh, invalid this account,${JSON.stringify(dbAccount)}`
|
41
|
-
// )
|
42
|
-
// dbAccount.valid = 'invalid'
|
43
|
-
// dbAccount.lastModifiedAt = now
|
44
|
-
// await ctx.database.upsert('BSRelateOAuthAccount', [dbAccount])
|
45
|
-
// session.sendQuote(
|
46
|
-
// session.text('commands.bsbot.subscribe.alert.invalid-token')
|
47
|
-
// )
|
48
|
-
// return
|
49
|
-
// }
|
50
|
-
//
|
51
|
-
// logger.info(`refresh beatsaver token successfully ${dbAccount.id}`)
|
52
|
-
// dbAccount.accessToken = token.data.access_token
|
53
|
-
// dbAccount.refreshToken = token.data.refresh_token
|
54
|
-
// dbAccount.lastRefreshAt = now
|
55
|
-
// dbAccount.lastModifiedAt = now
|
56
|
-
// await ctx.database.upsert('BSRelateOAuthAccount', [dbAccount])
|
57
|
-
// alerts = await api.BeatSaver.wrapperResult().getUnreadAlertsByPage(
|
58
|
-
// dbAccount.accessToken,
|
59
|
-
// 0
|
60
|
-
// )
|
61
|
-
// }
|
62
|
-
// if (!alerts.isSuccess()) {
|
63
|
-
// session.sendQuote(
|
64
|
-
// session.text('commands.bsbot.subscribe.alert.not-success')
|
65
|
-
// )
|
66
|
-
// return
|
67
|
-
// }
|
68
|
-
// const lastId = alerts.data.length > 0 ? alerts.data[0].id : 0
|
69
|
-
// const now = new Date()
|
70
|
-
// const sub = {
|
71
|
-
// channelId: session.channelId,
|
72
|
-
// selfId: session.selfId,
|
73
|
-
// platform: session.platform,
|
74
|
-
// uid: session.uid,
|
75
|
-
// type: 'alert',
|
76
|
-
// enable: true,
|
77
|
-
// data: {
|
78
|
-
// lastNotifiedId: lastId,
|
79
|
-
// lastNotifiedAt: now,
|
80
|
-
// oauthAccountId: res[0].id,
|
81
|
-
// },
|
82
|
-
// }
|
83
|
-
// await ctx.database.upsert('BSBotSubscribe', [sub])
|
84
|
-
// session.sendQuote(session.text('commands.bsbot.subscribe.alert.success'))
|
85
|
-
// }
|
86
|
-
//# sourceMappingURL=alert.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../src/cmd/subscribe/alert.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,+BAA+B;AAC/B,kBAAkB;AAClB,qBAAqB;AACrB,0BAA0B;AAC1B,WAAW;AACX,mBAAmB;AACnB,SAAS;AACT,iEAAiE;AACjE,4BAA4B;AAC5B,6BAA6B;AAC7B,qBAAqB;AACrB,mBAAmB;AACnB,OAAO;AACP,0BAA0B;AAC1B,0BAA0B;AAC1B,uBAAuB;AACvB,aAAa;AACb,qBAAqB;AACrB,8CAA8C;AAC9C,yEAAyE;AACzE,aAAa;AACb,WAAW;AACX,QAAQ;AACR,aAAa;AACb,MAAM;AACN,6BAA6B;AAC7B,kDAAkD;AAClD,uBAAuB;AACvB,uDAAuD;AACvD,+BAA+B;AAC/B,yDAAyD;AACzD,2EAA2E;AAC3E,+BAA+B;AAC/B,QAAQ;AACR,6BAA6B;AAC7B,gCAAgC;AAChC,qBAAqB;AACrB,iFAAiF;AACjF,UAAU;AACV,oCAAoC;AACpC,uCAAuC;AACvC,uEAAuE;AACvE,2BAA2B;AAC3B,uEAAuE;AACvE,UAAU;AACV,eAAe;AACf,QAAQ;AACR,EAAE;AACF,0EAA0E;AAC1E,sDAAsD;AACtD,wDAAwD;AACxD,oCAAoC;AACpC,qCAAqC;AACrC,qEAAqE;AACrE,0EAA0E;AAC1E,+BAA+B;AAC/B,UAAU;AACV,QAAQ;AACR,MAAM;AACN,+BAA+B;AAC/B,yBAAyB;AACzB,mEAAmE;AACnE,QAAQ;AACR,aAAa;AACb,MAAM;AACN,kEAAkE;AAClE,2BAA2B;AAC3B,kBAAkB;AAClB,oCAAoC;AACpC,8BAA8B;AAC9B,kCAAkC;AAClC,wBAAwB;AACxB,qBAAqB;AACrB,oBAAoB;AACpB,cAAc;AACd,gCAAgC;AAChC,6BAA6B;AAC7B,mCAAmC;AACnC,SAAS;AACT,MAAM;AACN,uDAAuD;AACvD,8EAA8E;AAC9E,IAAI"}
|
File without changes
|
@@ -1,49 +0,0 @@
|
|
1
|
-
// import { $, Context, h, Logger } from 'koishi'
|
2
|
-
// import { Config } from '../../config'
|
3
|
-
// import { APIService, RenderService } from '../../service'
|
4
|
-
// import { BLScoreFilter } from '../../types'
|
5
|
-
//
|
6
|
-
// // manage bl filter condition
|
7
|
-
// export function BLFilterCmd(
|
8
|
-
// ctx: Context,
|
9
|
-
// // cfg: Config,
|
10
|
-
// render: RenderService,
|
11
|
-
// api: APIService,
|
12
|
-
// logger: Logger
|
13
|
-
// ) {
|
14
|
-
// const filterCmd = ctx
|
15
|
-
// .command('bsbot.subscribe.filter')
|
16
|
-
// .alias('bbfilter')
|
17
|
-
// .userFields(['id'])
|
18
|
-
// .option('type', '<type:string>')
|
19
|
-
// .action(async ({ session, options }, input) => {
|
20
|
-
// if (options.type === 'beatleader') {
|
21
|
-
// // check uid, check channel subscribe
|
22
|
-
// const channelSub = await ctx.database.get('BSBotSubscribe', {
|
23
|
-
// channelId: session.channelId,
|
24
|
-
// type: 'beatleader',
|
25
|
-
// })
|
26
|
-
// const channelFilter = channelSub[0].data as BLScoreFilter
|
27
|
-
// if (channelSub.length < 0) {
|
28
|
-
// session.sendQuote(
|
29
|
-
// session.text('commands.bsbot.subscribe.filter.bl.channel-no-sub')
|
30
|
-
// )
|
31
|
-
// }
|
32
|
-
// const ops = await session.prompt(30000)
|
33
|
-
// // d1
|
34
|
-
// // d2
|
35
|
-
// // d3
|
36
|
-
// // update rank only
|
37
|
-
// // update channel filter
|
38
|
-
// // update member filter
|
39
|
-
// // 当前筛选器
|
40
|
-
// // params
|
41
|
-
// session.channelId
|
42
|
-
// }
|
43
|
-
// })
|
44
|
-
// return {
|
45
|
-
// key: 'subscribe.filter',
|
46
|
-
// cmd: filterCmd,
|
47
|
-
// }
|
48
|
-
// }
|
49
|
-
//# sourceMappingURL=blfilters.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"blfilters.js","sourceRoot":"","sources":["../../../src/cmd/subscribe/blfilters.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,wCAAwC;AACxC,4DAA4D;AAC5D,8CAA8C;AAC9C,EAAE;AACF,gCAAgC;AAChC,+BAA+B;AAC/B,kBAAkB;AAClB,oBAAoB;AACpB,2BAA2B;AAC3B,qBAAqB;AACrB,mBAAmB;AACnB,MAAM;AACN,0BAA0B;AAC1B,yCAAyC;AACzC,yBAAyB;AACzB,0BAA0B;AAC1B,uCAAuC;AACvC,uDAAuD;AACvD,6CAA6C;AAC7C,kDAAkD;AAClD,wEAAwE;AACxE,0CAA0C;AAC1C,gCAAgC;AAChC,aAAa;AACb,oEAAoE;AACpE,uCAAuC;AACvC,+BAA+B;AAC/B,gFAAgF;AAChF,cAAc;AACd,YAAY;AACZ,kDAAkD;AAClD,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,8BAA8B;AAC9B,mCAAmC;AACnC,kCAAkC;AAClC,mBAAmB;AACnB,oBAAoB;AACpB,4BAA4B;AAC5B,UAAU;AACV,SAAS;AACT,aAAa;AACb,+BAA+B;AAC/B,sBAAsB;AACtB,MAAM;AACN,IAAI"}
|
File without changes
|
@@ -1,43 +0,0 @@
|
|
1
|
-
// import { Context, h } from 'koishi'
|
2
|
-
// import { APIService } from '../../service'
|
3
|
-
//
|
4
|
-
// export const scoresaber = async (
|
5
|
-
// ctx: Context,
|
6
|
-
// api: APIService,
|
7
|
-
// { session, options },
|
8
|
-
// input
|
9
|
-
// ) => {
|
10
|
-
// const scoresaberSubScribe = await ctx.database.get('BSBotSubscribe', {
|
11
|
-
// type: 'scoresaber',
|
12
|
-
// selfId: session.selfId,
|
13
|
-
// platform: session.platform,
|
14
|
-
// channelId: session.channelId,
|
15
|
-
// })
|
16
|
-
// if (scoresaberSubScribe.length > 0) {
|
17
|
-
// const sub = scoresaberSubScribe[0]
|
18
|
-
// if (sub.enable) {
|
19
|
-
// session.sendQuote(
|
20
|
-
// session.text('commands.bsbot.subscribe.scoresaber.exist')
|
21
|
-
// )
|
22
|
-
// return
|
23
|
-
// }
|
24
|
-
// const data = { ...sub, enable: true }
|
25
|
-
// await ctx.database.upsert('BSBotSubscribe', [data])
|
26
|
-
// session.sendQuote(
|
27
|
-
// session.text('commands.bsbot.subscribe.scoresaber.success')
|
28
|
-
// )
|
29
|
-
// return
|
30
|
-
// }
|
31
|
-
// const sub = {
|
32
|
-
// channelId: session.channelId,
|
33
|
-
// selfId: session.selfId,
|
34
|
-
// platform: session.platform,
|
35
|
-
// uid: session.uid,
|
36
|
-
// enable: true,
|
37
|
-
// type: 'scoresaber',
|
38
|
-
// data: {},
|
39
|
-
// }
|
40
|
-
// await ctx.database.upsert('BSBotSubscribe', [sub])
|
41
|
-
// session.sendQuote(session.text('commands.bsbot.subscribe.scoresaber.success'))
|
42
|
-
// }
|
43
|
-
//# sourceMappingURL=scoresaber.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scoresaber.js","sourceRoot":"","sources":["../../../src/cmd/subscribe/scoresaber.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,6CAA6C;AAC7C,EAAE;AACF,oCAAoC;AACpC,kBAAkB;AAClB,qBAAqB;AACrB,0BAA0B;AAC1B,UAAU;AACV,SAAS;AACT,2EAA2E;AAC3E,0BAA0B;AAC1B,8BAA8B;AAC9B,kCAAkC;AAClC,oCAAoC;AACpC,OAAO;AACP,0CAA0C;AAC1C,yCAAyC;AACzC,wBAAwB;AACxB,2BAA2B;AAC3B,oEAAoE;AACpE,UAAU;AACV,eAAe;AACf,QAAQ;AACR,4CAA4C;AAC5C,0DAA0D;AAC1D,yBAAyB;AACzB,oEAAoE;AACpE,QAAQ;AACR,aAAa;AACb,MAAM;AACN,kBAAkB;AAClB,oCAAoC;AACpC,8BAA8B;AAC9B,kCAAkC;AAClC,wBAAwB;AACxB,oBAAoB;AACpB,0BAA0B;AAC1B,gBAAgB;AAChB,MAAM;AACN,uDAAuD;AACvD,mFAAmF;AACnF,IAAI"}
|
package/lib/interface/db.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/interface/db.ts"],"names":[],"mappings":""}
|
File without changes
|
package/lib/interface/tables.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
//# sourceMappingURL=tables.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"tables.js","sourceRoot":"","sources":["../../src/interface/tables.ts"],"names":[],"mappings":""}
|
package/lib/utils.d.ts
DELETED
package/lib/utils.js
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.convertDiff = exports.sleep = void 0;
|
4
|
-
const sleep = async (millsec = 5000) => {
|
5
|
-
await new Promise((resolve, reject) => {
|
6
|
-
setTimeout(resolve, millsec);
|
7
|
-
});
|
8
|
-
};
|
9
|
-
exports.sleep = sleep;
|
10
|
-
const diffMap = {
|
11
|
-
E: 'Easy',
|
12
|
-
N: 'Normal',
|
13
|
-
H: 'Hard',
|
14
|
-
EX: 'Expert',
|
15
|
-
EP: 'ExpertPlus',
|
16
|
-
'EX+': 'ExpertPlus',
|
17
|
-
};
|
18
|
-
const convertDiff = (diff) => {
|
19
|
-
if (!diff) {
|
20
|
-
return diff;
|
21
|
-
}
|
22
|
-
return diffMap[diff.toUpperCase()];
|
23
|
-
};
|
24
|
-
exports.convertDiff = convertDiff;
|
25
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,KAAK,GAAG,KAAK,EAAE,UAAkB,IAAI,EAAE,EAAE;IACpD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAJY,QAAA,KAAK,SAIjB;AAED,MAAM,OAAO,GAAG;IACd,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,MAAM;IACT,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,YAAY;IAChB,KAAK,EAAE,YAAY;CACpB,CAAA;AAEM,MAAM,WAAW,GAAG,CAAC,IAAmB,EAAE,EAAE;IACjD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;AACpC,CAAC,CAAA;AALY,QAAA,WAAW,eAKvB"}
|