UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

99 lines (98 loc) 3.3 kB
import { __decorate } from "tslib"; import { Enumerable } from '@d-fischer/shared-utils'; import { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common'; /** * An EventSub event representing a suspicious user being updated in a channel. */ let EventSubChannelSuspiciousUserUpdateEvent = class EventSubChannelSuspiciousUserUpdateEvent extends DataObject { /** @internal */ constructor(data, client) { super(data); this._client = client; } /** * The ID of the channel where the treatment for a suspicious user was updated. */ get broadcasterId() { return this[rawDataSymbol].broadcaster_user_id; } /** * The name of the channel where the treatment for a suspicious user was updated. */ get broadcasterName() { return this[rawDataSymbol].broadcaster_user_login; } /** * The display name of the channel where the treatment for a suspicious user was updated. */ get broadcasterDisplayName() { return this[rawDataSymbol].broadcaster_user_name; } /** * Gets more information about the broadcaster. */ async getBroadcaster() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_user_id)); } /** * The ID of the moderator that updated the treatment for a suspicious user. */ get moderatorId() { return this[rawDataSymbol].moderator_user_id; } /** * The name of the moderator that updated the treatment for a suspicious user. */ get moderatorName() { return this[rawDataSymbol].moderator_user_login; } /** * The display name of the moderator that updated the treatment for a suspicious user. */ get moderatorDisplayName() { return this[rawDataSymbol].moderator_user_name; } /** * Gets more information about the moderator. */ async getModerator() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].moderator_user_id)); } /** * The ID of the suspicious user whose treatment was updated. */ get userId() { return this[rawDataSymbol].user_id; } /** * The name of the suspicious user whose treatment was updated. */ get userName() { return this[rawDataSymbol].user_login; } /** * The display name of the suspicious user whose treatment was updated. */ get userDisplayName() { return this[rawDataSymbol].user_name; } /** * Gets more information about the user whose treatment was updated. */ async getUser() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id)); } /** * The status set for the suspicious user. */ get lowTrustStatus() { return this[rawDataSymbol].low_trust_status; } }; __decorate([ Enumerable(false) ], EventSubChannelSuspiciousUserUpdateEvent.prototype, "_client", void 0); EventSubChannelSuspiciousUserUpdateEvent = __decorate([ rtfm('eventsub-base', 'EventSubChannelSuspiciousUserUpdateEvent', 'broadcasterId') ], EventSubChannelSuspiciousUserUpdateEvent); export { EventSubChannelSuspiciousUserUpdateEvent };