koishi-plugin-cfmrmod 1.0.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/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Config = exports.name = void 0;
37
+ exports.apply = apply;
38
+ const koishi_1 = require("koishi");
39
+ const cfmr = __importStar(require("./plugins/cfmr"));
40
+ const mcmod = __importStar(require("./plugins/mcmod"));
41
+ exports.name = 'minecraft-search';
42
+ exports.Config = koishi_1.Schema.object({
43
+ prefixes: koishi_1.Schema.object({
44
+ cf: koishi_1.Schema.string().default('cf'),
45
+ mr: koishi_1.Schema.string().default('mr'),
46
+ cnmc: koishi_1.Schema.string().default('cnmc'),
47
+ }).description('指令前缀设置'),
48
+ fontPath: koishi_1.Schema.string().role('path').description('中文字体路径 (建议使用含中文和Emoji的字体)'),
49
+ timeouts: koishi_1.Schema.number().default(60000).description('搜索会话超时时间(ms)'),
50
+ debug: koishi_1.Schema.boolean().default(false).description('开启调试日志'),
51
+ cfmr: cfmr.Config.description('CurseForge/Modrinth 搜索与图片卡片'),
52
+ mcmod: mcmod.Config.description('MCMod.cn 搜索与图片卡片'),
53
+ });
54
+ function apply(ctx, config) {
55
+ const prefixes = (config === null || config === void 0 ? void 0 : config.prefixes) || {};
56
+ const shared = {
57
+ prefixes,
58
+ fontPath: config === null || config === void 0 ? void 0 : config.fontPath,
59
+ timeouts: config === null || config === void 0 ? void 0 : config.timeouts,
60
+ debug: config === null || config === void 0 ? void 0 : config.debug,
61
+ };
62
+ if (cfmr.apply)
63
+ cfmr.apply(ctx, { ...((config === null || config === void 0 ? void 0 : config.cfmr) || {}), ...shared });
64
+ if (mcmod.apply)
65
+ mcmod.apply(ctx, { ...((config === null || config === void 0 ? void 0 : config.mcmod) || {}), ...shared });
66
+ }