@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
36 lines (35 loc) • 1.13 kB
JavaScript
import { __decorate } from "tslib";
import { DataObject, rawDataSymbol, rtfm } from '@twurple/common';
/**
* The bounds of the text that caused the message to be caught.
*/
let EventSubAutoModMessageAutoModBoundary = class EventSubAutoModMessageAutoModBoundary extends DataObject {
_messageText;
/** @internal */
constructor(data, _messageText) {
super(data);
this._messageText = _messageText;
}
/**
* The start index (inclusive) of the problematic text in the message.
*/
get start() {
return this[rawDataSymbol].start_pos;
}
/**
* The end index (inclusive) of the problematic text in the message.
*/
get end() {
return this[rawDataSymbol].end_pos;
}
/**
* The problematic text that caused message to be caught.
*/
get text() {
return this._messageText.substring(this.start, this.end + 1);
}
};
EventSubAutoModMessageAutoModBoundary = __decorate([
rtfm('eventsub-base', 'EventSubAutoModMessageAutoModBoundary')
], EventSubAutoModMessageAutoModBoundary);
export { EventSubAutoModMessageAutoModBoundary };