UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

88 lines (87 loc) 2.77 kB
import { __decorate } from "tslib"; import { Enumerable } from '@d-fischer/shared-utils'; import { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common'; /** * An EventSub event representing an unban request in a channel. */ let EventSubChannelUnbanRequestCreateEvent = class EventSubChannelUnbanRequestCreateEvent extends DataObject { /** @internal */ _client; /** @internal */ constructor(data, client) { super(data); this._client = client; } /** * The ID of the unban request. */ get id() { return this[rawDataSymbol].id; } /** * The ID of the broadcaster in which channel the unban request was created. */ get broadcasterId() { return this[rawDataSymbol].broadcaster_user_id; } /** * The name of the broadcaster in which channel the unban request was created. */ get broadcasterName() { return this[rawDataSymbol].broadcaster_user_login; } /** * The display name of the broadcaster in which channel the unban request was created. */ get broadcasterDisplayName() { return this[rawDataSymbol].broadcaster_user_name; } /** * Gets more information about the broadcaster in which channel the unban request was created. */ async getBroadcaster() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_user_id)); } /** * The ID of the user that is requesting to be unbanned. */ get userId() { return this[rawDataSymbol].user_id; } /** * The name of the user that is requesting to be unbanned. */ get userName() { return this[rawDataSymbol].user_login; } /** * The display name of the user that is requesting to be unbanned. */ get userDisplayName() { return this[rawDataSymbol].user_name; } /** * Gets more information about the user that requested to be unbanned. */ async getUser() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id)); } /** * The message sent in the unban request. */ get message() { return this[rawDataSymbol].text; } /** * Date when the unban request was created. */ get creationDate() { return new Date(this[rawDataSymbol].created_at); } }; __decorate([ Enumerable(false) ], EventSubChannelUnbanRequestCreateEvent.prototype, "_client", void 0); EventSubChannelUnbanRequestCreateEvent = __decorate([ rtfm('eventsub-base', 'EventSubChannelUnbanRequestCreateEvent', 'id') ], EventSubChannelUnbanRequestCreateEvent); export { EventSubChannelUnbanRequestCreateEvent };