UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

125 lines (124 loc) 3.99 kB
import { __decorate } from "tslib"; import { Enumerable } from '@d-fischer/shared-utils'; import { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common'; /** * An EventSub event representing the AutoMod settings being updated in a channel. */ let EventSubAutoModSettingsUpdateEvent = class EventSubAutoModSettingsUpdateEvent extends DataObject { /** @internal */ constructor(data, client) { super(data); this._client = client; } /** * The ID of the broadcaster in whose channel the AutoMod settings were updated. */ get broadcasterId() { return this[rawDataSymbol].broadcaster_user_id; } /** * The name of the broadcaster in whose channel the AutoMod settings were changed. */ get broadcasterName() { return this[rawDataSymbol].broadcaster_user_login; } /** * The display name of the broadcaster in whose channel the AutoMod settings were changed. */ 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 who changed the AutoMod settings. */ get moderatorId() { return this[rawDataSymbol].moderator_user_id; } /** * The name of the moderator who changed the AutoMod settings. */ get moderatorName() { return this[rawDataSymbol].moderator_user_login; } /** * The display name of the moderator who changed the AutoMod settings. */ 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 default AutoMod level for the broadcaster. * * This field is `null` if the broadcaster has set one or more of the individual settings. */ get overallLevel() { return this[rawDataSymbol].overall_level; } /** * The AutoMod level for hostility involving aggression. */ get aggression() { return this[rawDataSymbol].aggression; } /** * The AutoMod level for hostility involving name-calling, insults, or antagonization. */ get bullying() { return this[rawDataSymbol].bullying; } /** * The AutoMod level for discrimination against perceived or actual mental or physical abilities. */ get disability() { return this[rawDataSymbol].disability; } /** * The AutoMod level for discrimination against women. */ get misogyny() { return this[rawDataSymbol].misogyny; } /** * The AutoMod level for discrimination based on race, ethnicity, or religion. */ get raceEthnicityOrReligion() { return this[rawDataSymbol].race_ethnicity_or_religion; } /** * The AutoMod level for sex-based terms, e.g. sexual acts or anatomy. */ get sexBasedTerms() { return this[rawDataSymbol].sex_based_terms; } /** * The AutoMod level for discrimination based on sexuality, sex, or gender. */ get sexualitySexOrGender() { return this[rawDataSymbol].sexuality_sex_or_gender; } /** * The AutoMod level for profanity. */ get swearing() { return this[rawDataSymbol].swearing; } }; __decorate([ Enumerable(false) ], EventSubAutoModSettingsUpdateEvent.prototype, "_client", void 0); EventSubAutoModSettingsUpdateEvent = __decorate([ rtfm('eventsub-base', 'EventSubAutoModSettingsUpdateEvent', 'broadcasterId') ], EventSubAutoModSettingsUpdateEvent); export { EventSubAutoModSettingsUpdateEvent };