UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

128 lines (127 loc) 4.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubAutoModSettingsUpdateEvent = void 0; const tslib_1 = require("tslib"); const shared_utils_1 = require("@d-fischer/shared-utils"); const common_1 = require("@twurple/common"); /** * An EventSub event representing the AutoMod settings being updated in a channel. */ let EventSubAutoModSettingsUpdateEvent = class EventSubAutoModSettingsUpdateEvent extends common_1.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[common_1.rawDataSymbol].broadcaster_user_id; } /** * The name of the broadcaster in whose channel the AutoMod settings were changed. */ get broadcasterName() { return this[common_1.rawDataSymbol].broadcaster_user_login; } /** * The display name of the broadcaster in whose channel the AutoMod settings were changed. */ get broadcasterDisplayName() { return this[common_1.rawDataSymbol].broadcaster_user_name; } /** * Gets more information about the broadcaster. */ async getBroadcaster() { return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_user_id)); } /** * The ID of the moderator who changed the AutoMod settings. */ get moderatorId() { return this[common_1.rawDataSymbol].moderator_user_id; } /** * The name of the moderator who changed the AutoMod settings. */ get moderatorName() { return this[common_1.rawDataSymbol].moderator_user_login; } /** * The display name of the moderator who changed the AutoMod settings. */ get moderatorDisplayName() { return this[common_1.rawDataSymbol].moderator_user_name; } /** * Gets more information about the moderator. */ async getModerator() { return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.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[common_1.rawDataSymbol].overall_level; } /** * The AutoMod level for hostility involving aggression. */ get aggression() { return this[common_1.rawDataSymbol].aggression; } /** * The AutoMod level for hostility involving name-calling, insults, or antagonization. */ get bullying() { return this[common_1.rawDataSymbol].bullying; } /** * The AutoMod level for discrimination against perceived or actual mental or physical abilities. */ get disability() { return this[common_1.rawDataSymbol].disability; } /** * The AutoMod level for discrimination against women. */ get misogyny() { return this[common_1.rawDataSymbol].misogyny; } /** * The AutoMod level for discrimination based on race, ethnicity, or religion. */ get raceEthnicityOrReligion() { return this[common_1.rawDataSymbol].race_ethnicity_or_religion; } /** * The AutoMod level for sex-based terms, e.g. sexual acts or anatomy. */ get sexBasedTerms() { return this[common_1.rawDataSymbol].sex_based_terms; } /** * The AutoMod level for discrimination based on sexuality, sex, or gender. */ get sexualitySexOrGender() { return this[common_1.rawDataSymbol].sexuality_sex_or_gender; } /** * The AutoMod level for profanity. */ get swearing() { return this[common_1.rawDataSymbol].swearing; } }; exports.EventSubAutoModSettingsUpdateEvent = EventSubAutoModSettingsUpdateEvent; tslib_1.__decorate([ (0, shared_utils_1.Enumerable)(false) ], EventSubAutoModSettingsUpdateEvent.prototype, "_client", void 0); exports.EventSubAutoModSettingsUpdateEvent = EventSubAutoModSettingsUpdateEvent = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubAutoModSettingsUpdateEvent', 'broadcasterId') ], EventSubAutoModSettingsUpdateEvent);