talkshitgetdared
Version:
The truth will hurt. An open-source cursed-core engine for Truth & Dare prompts.
106 lines • 3.69 kB
JavaScript
"use strict";
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TruthOrDareCore = void 0;
const path = __importStar(require("path"));
const index_1 = require("../services/index");
class TruthOrDareCore {
constructor(config) {
this.config = {
defaultLanguage: 'english',
defaultMode: 'sfw',
dataPath: path.join(__dirname, '..', '..', '..', 'data', 'lang'),
enableHistory: false,
historySize: 50,
...config,
};
this.promptService = new index_1.PromptService(this.config);
this.statisticsService = new index_1.StatisticsService(this.promptService['dataLoader']);
}
getTruth(options = {}) {
return this.promptService.getTruth(options);
}
getDare(options = {}) {
return this.promptService.getDare(options);
}
getRandom(options = {}) {
return this.promptService.getRandom(options);
}
getBatch(options) {
return this.promptService.getBatch(options);
}
getAvailableLanguages() {
return this.promptService.getAvailableLanguages();
}
getAvailableModes(language) {
return this.promptService.getAvailableModes(language);
}
getStats() {
return this.statisticsService.getStats();
}
enableHistory(enabled) {
this.promptService.getHistoryService().setEnabled(enabled);
}
isHistoryEnabled() {
return this.promptService.getHistoryService().isEnabled();
}
getHistory() {
return this.promptService.getHistoryService().getHistory();
}
clearHistory() {
this.promptService.getHistoryService().clearHistory();
}
setHistorySize(size) {
this.promptService.getHistoryService().setMaxSize(size);
}
getHistorySize() {
return this.promptService.getHistoryService().getMaxSize();
}
clearCache() {
this.promptService.clearCache();
}
getCacheStats() {
return this.promptService.getCacheStats();
}
updateConfig(newConfig) {
this.config = { ...this.config, ...newConfig };
this.promptService.updateConfig(this.config);
}
getConfig() {
return { ...this.config };
}
}
exports.TruthOrDareCore = TruthOrDareCore;
//# sourceMappingURL=TruthOrDareCore.js.map