@ayanaware/bentocord
Version:
Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.
33 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocalizedCodeblockBuilder = void 0;
const CodeblockBuilder_1 = require("./CodeblockBuilder");
class LocalizedCodeblockBuilder extends CodeblockBuilder_1.CodeblockBuilder {
constructor(ctx, language) {
super(language);
this.ctx = ctx;
}
async setTranslatedHeader(key, repl, backup) {
const translated = await this.ctx.formatTranslation(key, repl, backup);
return this.setHeader(translated);
}
async setTranslatedFooter(key, repl, backup) {
const translated = await this.ctx.formatTranslation(key, repl, backup);
return this.setFooter(translated);
}
async addTranslatedLine(item, value) {
if (typeof item === 'object')
item = await this.ctx.formatTranslation(item);
if (value !== undefined) {
if (typeof value === 'object')
value = await this.ctx.formatTranslation(value);
this.addLine(item, value);
}
else {
this.addLine(item);
}
return this;
}
}
exports.LocalizedCodeblockBuilder = LocalizedCodeblockBuilder;
//# sourceMappingURL=LocalizedCodeblockBuilder.js.map