UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

95 lines (94 loc) 3.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubChannelChatSettingsUpdateEvent = 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 chat settings being updated in a channel. */ let EventSubChannelChatSettingsUpdateEvent = class EventSubChannelChatSettingsUpdateEvent extends common_1.DataObject { /** @internal */ constructor(data, client) { super(data); this._client = client; } /** * The ID of the broadcaster. */ get broadcasterId() { return this[common_1.rawDataSymbol].broadcaster_user_id; } /** * The name of the broadcaster. */ get broadcasterName() { return this[common_1.rawDataSymbol].broadcaster_user_login; } /** * The display name of the broadcaster. */ 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)); } /** * Whether emote only mode is enabled. */ get emoteOnlyModeEnabled() { return this[common_1.rawDataSymbol].emote_mode; } /** * Whether follower only mode is enabled. */ get followerOnlyModeEnabled() { return this[common_1.rawDataSymbol].follower_mode; } /** * The time after which users are able to send messages after following, in minutes. * * Is `null` if follower only mode is not enabled, * but may also be `0` if you can send messages immediately after following. */ get followerOnlyModeDelay() { return this[common_1.rawDataSymbol].follower_mode_duration_minutes; } /** * Whether slow mode is enabled. */ get slowModeEnabled() { return this[common_1.rawDataSymbol].slow_mode; } /** * The time to wait between messages in slow mode, in seconds. * * Is `null` if slow mode is not enabled. */ get slowModeDelay() { return this[common_1.rawDataSymbol].slow_mode_wait_time_seconds; } /** * Whether subscriber only mode is enabled. */ get subscriberOnlyModeEnabled() { return this[common_1.rawDataSymbol].subscriber_mode; } /** * Whether unique chat mode is enabled. */ get uniqueChatModeEnabled() { return this[common_1.rawDataSymbol].unique_chat_mode; } }; exports.EventSubChannelChatSettingsUpdateEvent = EventSubChannelChatSettingsUpdateEvent; tslib_1.__decorate([ (0, shared_utils_1.Enumerable)(false) ], EventSubChannelChatSettingsUpdateEvent.prototype, "_client", void 0); exports.EventSubChannelChatSettingsUpdateEvent = EventSubChannelChatSettingsUpdateEvent = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubChannelChatSettingsUpdateEvent', 'broadcasterId') ], EventSubChannelChatSettingsUpdateEvent);