@oebot/core
Version:
能跑就行的 QQ 机器人框架,基于 oicq v2,改自KiviBot(R.I.P.)
25 lines (24 loc) • 847 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OEPluginError = void 0;
const log4js_1 = __importDefault(require("log4js"));
const utils_1 = require("../../utils");
/** OEBot 插件错误类 */
class OEPluginError extends Error {
constructor(name, message) {
super();
this.name = 'OEPluginError';
this.pluginName = name;
this.message = message ?? '';
}
log() {
const logger = log4js_1.default.getLogger('plugin');
const info = `插件 ${utils_1.colors.cyan(this.pluginName)} 抛出错误: ${this.message}`;
logger.error(info);
return this.message;
}
}
exports.OEPluginError = OEPluginError;