@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
90 lines (89 loc) • 3.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubAutoModTermsUpdateEvent = void 0;
const tslib_1 = require("tslib");
const shared_utils_1 = require("@d-fischer/shared-utils");
const common_1 = require("@twurple/common");
/**
* An EventSub event representing AutoMod terms being updated in a channel.
*/
let EventSubAutoModTermsUpdateEvent = class EventSubAutoModTermsUpdateEvent extends common_1.DataObject {
/** @internal */
constructor(data, client) {
super(data);
this._client = client;
}
/**
* The ID of the broadcaster in whose channel AutoMod terms were updated.
*/
get broadcasterId() {
return this[common_1.rawDataSymbol].broadcaster_user_id;
}
/**
* The name of the broadcaster in whose channel AutoMod terms were updated.
*/
get broadcasterName() {
return this[common_1.rawDataSymbol].broadcaster_user_login;
}
/**
* The display name of the broadcaster in whose channel AutoMod terms were updated.
*/
get broadcasterDisplayName() {
return this[common_1.rawDataSymbol].broadcaster_user_name;
}
/**
* Gets more information about the broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_user_id));
}
/**
* The ID of the moderator who updated AutoMod terms.
*/
get moderatorId() {
return this[common_1.rawDataSymbol].moderator_user_id;
}
/**
* The name of the moderator who updated AutoMod terms.
*/
get moderatorName() {
return this[common_1.rawDataSymbol].moderator_user_login;
}
/**
* The display name of the moderator who updated AutoMod terms.
*/
get moderatorDisplayName() {
return this[common_1.rawDataSymbol].moderator_user_name;
}
/**
* Gets more information about the moderator.
*/
async getModerator() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].moderator_user_id));
}
/**
* The status change applied to the terms.
*/
get action() {
return this[common_1.rawDataSymbol].action;
}
/**
* Indicates whether this term was added due to an AutoMod message resolution action.
*/
get fromAutoMod() {
return this[common_1.rawDataSymbol].from_automod;
}
/**
* The list of terms that had a status change.
*/
get terms() {
return this[common_1.rawDataSymbol].terms;
}
};
exports.EventSubAutoModTermsUpdateEvent = EventSubAutoModTermsUpdateEvent;
tslib_1.__decorate([
(0, shared_utils_1.Enumerable)(false)
], EventSubAutoModTermsUpdateEvent.prototype, "_client", void 0);
exports.EventSubAutoModTermsUpdateEvent = EventSubAutoModTermsUpdateEvent = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubAutoModTermsUpdateEvent', 'broadcasterId')
], EventSubAutoModTermsUpdateEvent);