@nonebot/koishi-plugin-crazy-thursday
Version:
23 lines (22 loc) • 978 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.apply = exports.Config = exports.using = exports.name = void 0;
const koishi_1 = require("koishi");
const path_1 = require("path");
exports.name = 'crazy-thursday';
exports.using = ['nonebot'];
exports.Config = koishi_1.Schema.object({
crazy_path: koishi_1.Schema.string()
.description('读取文案的路径 (相对于插件源码目录)。')
.default(''),
});
async function apply(ctx, config) {
const { Path } = ctx.nonebot.python.pyimport('pathlib');
const srcPath = (0, path_1.resolve)(__dirname, '../nonebot_plugin_crazy_thursday/nonebot_plugin_crazy_thursday');
const tmpPath = ctx.nonebot.mountTemp((0, path_1.resolve)(srcPath, config.crazy_path));
await ctx.nonebot.install((0, path_1.resolve)(__dirname, '../dist'));
await ctx.nonebot.import(srcPath, {
crazy_path: Path(tmpPath),
});
}
exports.apply = apply;