UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

60 lines (59 loc) 1.79 kB
import { __decorate } from "tslib"; import { DataObject, rawDataSymbol, rtfm } from '@twurple/common'; /** * An object representing an AutoMod blocked term that caused the message to be caught. */ let EventSubAutoModMessageBlockedTerm = class EventSubAutoModMessageBlockedTerm extends DataObject { _messageText; /** @internal */ constructor(data, _messageText) { super(data); this._messageText = _messageText; } /** * The ID of the blocked term. */ get id() { return this[rawDataSymbol].term_id; } /** * The start index (inclusive) of the blocked term in the message. */ get start() { return this[rawDataSymbol].boundary.start_pos; } /** * The end index (inclusive) of the blocked term in the message. */ get end() { return this[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[rawDataSymbol].owner_broadcaster_user_id; } /** * The name of the broadcaster that owns the blocked term. */ get ownerBroadcasterName() { return this[rawDataSymbol].owner_broadcaster_user_login; } /** * The display name of the broadcaster that owns the blocked term. */ get ownerBroadcasterDisplayName() { return this[rawDataSymbol].owner_broadcaster_user_name; } }; EventSubAutoModMessageBlockedTerm = __decorate([ rtfm('eventsub-base', 'EventSubAutoModMessageBlockedTerm') ], EventSubAutoModMessageBlockedTerm); export { EventSubAutoModMessageBlockedTerm };