@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
62 lines (61 loc) • 2.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubAutoModMessageBlockedTerm = void 0;
const tslib_1 = require("tslib");
const common_1 = require("@twurple/common");
/**
* An object representing an AutoMod blocked term that caused the message to be caught.
*/
let EventSubAutoModMessageBlockedTerm = class EventSubAutoModMessageBlockedTerm extends common_1.DataObject {
/** @internal */
constructor(data, _messageText) {
super(data);
this._messageText = _messageText;
}
/**
* The ID of the blocked term.
*/
get id() {
return this[common_1.rawDataSymbol].term_id;
}
/**
* The start index (inclusive) of the blocked term in the message.
*/
get start() {
return this[common_1.rawDataSymbol].boundary.start_pos;
}
/**
* The end index (inclusive) of the blocked term in the message.
*/
get end() {
return this[common_1.rawDataSymbol].boundary.end_pos;
}
/**
* The text of the blocked term.
*/
get text() {
return this._messageText.substring(this.start, this.end + 1);
}
/**
* The ID of the broadcaster that owns the blocked term.
*/
get ownerBroadcasterId() {
return this[common_1.rawDataSymbol].owner_broadcaster_user_id;
}
/**
* The name of the broadcaster that owns the blocked term.
*/
get ownerBroadcasterName() {
return this[common_1.rawDataSymbol].owner_broadcaster_user_login;
}
/**
* The display name of the broadcaster that owns the blocked term.
*/
get ownerBroadcasterDisplayName() {
return this[common_1.rawDataSymbol].owner_broadcaster_user_name;
}
};
exports.EventSubAutoModMessageBlockedTerm = EventSubAutoModMessageBlockedTerm;
exports.EventSubAutoModMessageBlockedTerm = EventSubAutoModMessageBlockedTerm = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubAutoModMessageBlockedTerm')
], EventSubAutoModMessageBlockedTerm);