@averagehelper/corde
Version:
A simple library for Discord bot tests. (Republished fork to demonstrate a bugfix)
32 lines (31 loc) • 1.45 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToSetRoleHoist = void 0;
const operation_1 = require("../operation");
class ToSetRoleHoist extends operation_1.ExpectOperation {
action(hoist, roleData) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield this.cordeBot.sendTextMessage(this.command);
const role = yield this.cordeBot.findRole(roleData);
if (role.hoist === hoist) {
this.isEqual = true;
}
}
catch (error) {
this.catchExecutionError(error);
}
return this.generateReport();
});
}
}
exports.ToSetRoleHoist = ToSetRoleHoist;