@ayanaware/bentocord
Version:
Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.
20 lines • 702 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BooleanOptionResolver = void 0;
const eris_1 = require("eris");
const OptionType_1 = require("../constants/OptionType");
class BooleanOptionResolver {
constructor() {
this.option = OptionType_1.OptionType.BOOLEAN;
this.convert = eris_1.Constants.ApplicationCommandOptionTypes.BOOLEAN;
}
async resolve(ctx, option, input) {
if (/^true|t|yes|y|1$/i.exec(input))
return true;
if (/^false|f|no|n|0$/i.exec(input))
return false;
return null;
}
}
exports.BooleanOptionResolver = BooleanOptionResolver;
//# sourceMappingURL=BooleanOption.js.map