@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
38 lines (37 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubAutoModMessageAutoModBoundary = void 0;
const tslib_1 = require("tslib");
const common_1 = require("@twurple/common");
/**
* The bounds of the text that caused the message to be caught.
*/
let EventSubAutoModMessageAutoModBoundary = class EventSubAutoModMessageAutoModBoundary extends common_1.DataObject {
/** @internal */
constructor(data, _messageText) {
super(data);
this._messageText = _messageText;
}
/**
* The start index (inclusive) of the problematic text in the message.
*/
get start() {
return this[common_1.rawDataSymbol].start_pos;
}
/**
* The end index (inclusive) of the problematic text in the message.
*/
get end() {
return this[common_1.rawDataSymbol].end_pos;
}
/**
* The problematic text that caused message to be caught.
*/
get text() {
return this._messageText.substring(this.start, this.end + 1);
}
};
exports.EventSubAutoModMessageAutoModBoundary = EventSubAutoModMessageAutoModBoundary;
exports.EventSubAutoModMessageAutoModBoundary = EventSubAutoModMessageAutoModBoundary = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubAutoModMessageAutoModBoundary')
], EventSubAutoModMessageAutoModBoundary);