UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

56 lines (55 loc) 2.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubChannelSharedChatTimeoutModerationEvent = void 0; const tslib_1 = require("tslib"); const common_1 = require("@twurple/common"); const EventSubChannelBaseModerationEvent_1 = require("./EventSubChannelBaseModerationEvent"); /** * An EventSub event representing a moderator timing out a user in another channel during a shared chat session. */ let EventSubChannelSharedChatTimeoutModerationEvent = class EventSubChannelSharedChatTimeoutModerationEvent extends EventSubChannelBaseModerationEvent_1.EventSubChannelBaseModerationEvent { constructor() { super(...arguments); this.moderationAction = 'shared_chat_timeout'; } /** * The ID of the user being timed out. */ get userId() { return this[common_1.rawDataSymbol].shared_chat_timeout.user_id; } /** * The name of the user being timed out. */ get userName() { return this[common_1.rawDataSymbol].shared_chat_timeout.user_login; } /** * The display name of the user being timed out. */ get userDisplayName() { return this[common_1.rawDataSymbol].shared_chat_timeout.user_name; } /** * Gets more information about the user. */ async getUser() { return await this._client.users.getUserById(this[common_1.rawDataSymbol].shared_chat_timeout.user_id); } /** * The reason given for the timeout. */ get reason() { return this[common_1.rawDataSymbol].shared_chat_timeout.reason; } /** * The time at which the timeout ends. */ get expiryDate() { return new Date(this[common_1.rawDataSymbol].shared_chat_timeout.expires_at); } }; exports.EventSubChannelSharedChatTimeoutModerationEvent = EventSubChannelSharedChatTimeoutModerationEvent; exports.EventSubChannelSharedChatTimeoutModerationEvent = EventSubChannelSharedChatTimeoutModerationEvent = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubChannelSharedChatTimeoutModerationEvent', 'broadcasterId') ], EventSubChannelSharedChatTimeoutModerationEvent);