UNPKG

@oebot/core

Version:

能跑就行的 QQ 机器人框架,基于 oicq v2,改自KiviBot(R.I.P.)

15 lines (14 loc) 682 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPluginNameByPath = void 0; const node_os_1 = __importDefault(require("node:os")); const isWin = node_os_1.default.platform() === 'win32'; /** 通过模块路径获取插件名称,如果是 `npm` 插件,则自动去掉 `oebot-plugin-` 前缀 */ function getPluginNameByPath(path) { const paths = path.split(isWin ? '\\' : '/'); return paths[paths.length - 1].replace(/^oebot-plugin-/i, ''); } exports.getPluginNameByPath = getPluginNameByPath;