koishi-plugin-steam-family-bot
Version:
一个用于新版 Steam 家庭的库存监控 koishi Bot 插件
42 lines • 1.66 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.KoishiBotService = void 0;
const interface_1 = require("../interface");
const schedule_session_1 = require("../session/schedule-session");
__exportStar(require("./schedule-session"), exports);
__exportStar(require("./cmd-session"), exports);
class KoishiBotService {
ctx;
config;
tmpFileStorage;
constructor(ctx, config) {
this.ctx = ctx;
this.config = config;
if (config.uploadImageToS3.enable) {
this.tmpFileStorage = new interface_1.TmpFileStorage(config);
}
}
getSessionByChannelInfo(channelInfo) {
const bot = this.ctx.bots[`${channelInfo.platform}:${channelInfo.selfId}`];
if (bot) {
return new schedule_session_1.KoishiSession(bot, channelInfo, this.tmpFileStorage);
}
return undefined;
}
}
exports.KoishiBotService = KoishiBotService;
//# sourceMappingURL=index.js.map