@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
50 lines (49 loc) • 1.75 kB
JavaScript
import { __decorate } from "tslib";
import { rawDataSymbol, rtfm } from '@twurple/common';
import { EventSubChannelBaseModerationEvent } from './EventSubChannelBaseModerationEvent.js';
/**
* An EventSub event representing a moderator timing out a user in another channel during a shared chat session.
*/
let EventSubChannelSharedChatTimeoutModerationEvent = class EventSubChannelSharedChatTimeoutModerationEvent extends EventSubChannelBaseModerationEvent {
moderationAction = 'shared_chat_timeout';
/**
* The ID of the user being timed out.
*/
get userId() {
return this[rawDataSymbol].shared_chat_timeout.user_id;
}
/**
* The name of the user being timed out.
*/
get userName() {
return this[rawDataSymbol].shared_chat_timeout.user_login;
}
/**
* The display name of the user being timed out.
*/
get userDisplayName() {
return this[rawDataSymbol].shared_chat_timeout.user_name;
}
/**
* Gets more information about the user.
*/
async getUser() {
return await this._client.users.getUserById(this[rawDataSymbol].shared_chat_timeout.user_id);
}
/**
* The reason given for the timeout.
*/
get reason() {
return this[rawDataSymbol].shared_chat_timeout.reason;
}
/**
* The time at which the timeout ends.
*/
get expiryDate() {
return new Date(this[rawDataSymbol].shared_chat_timeout.expires_at);
}
};
EventSubChannelSharedChatTimeoutModerationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelSharedChatTimeoutModerationEvent', 'broadcasterId')
], EventSubChannelSharedChatTimeoutModerationEvent);
export { EventSubChannelSharedChatTimeoutModerationEvent };