UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

112 lines (111 loc) 3.63 kB
import { __decorate } from "tslib"; import { Enumerable } from '@d-fischer/shared-utils'; import { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common'; /** * An EventSub event representing the resolution of an unban request in a channel. */ let EventSubChannelUnbanRequestResolveEvent = class EventSubChannelUnbanRequestResolveEvent extends DataObject { /** @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 resolved. */ get broadcasterId() { return this[rawDataSymbol].broadcaster_user_id; } /** * The name of the broadcaster in which channel the unban request was resolved. */ get broadcasterName() { return this[rawDataSymbol].broadcaster_user_login; } /** * The display name of the broadcaster in which channel the unban request was resolved. */ get broadcasterDisplayName() { return this[rawDataSymbol].broadcaster_user_name; } /** * Gets more information about the broadcaster in which channel the unban request was resolved. */ async getBroadcaster() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_user_id)); } /** * The ID of the moderator that resolved the unban request. */ get moderatorId() { return this[rawDataSymbol].moderator_user_id; } /** * The name of the moderator that resolved the unban request. */ get moderatorName() { return this[rawDataSymbol].moderator_user_login; } /** * The display name of the moderator that resolved the unban request. */ get moderatorDisplayName() { return this[rawDataSymbol].moderator_user_name; } /** * Gets more information about the moderator that resolved the unban request. */ async getModerator() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].moderator_user_id)); } /** * The ID of the user that requested to be unbanned. */ get userId() { return this[rawDataSymbol].user_id; } /** * The name of the user that requested to be unbanned. */ get userName() { return this[rawDataSymbol].user_login; } /** * The display name of the user that requested 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 supplied by the mod/broadcaster upon resolution of the request. */ get resolutionMessage() { var _a; return (_a = this[rawDataSymbol].resolution_text) !== null && _a !== void 0 ? _a : null; } /** * The status of the resolved unban request. */ get status() { return this[rawDataSymbol].status; } }; __decorate([ Enumerable(false) ], EventSubChannelUnbanRequestResolveEvent.prototype, "_client", void 0); EventSubChannelUnbanRequestResolveEvent = __decorate([ rtfm('eventsub-base', 'EventSubChannelUnbanRequestResolveEvent', 'id') ], EventSubChannelUnbanRequestResolveEvent); export { EventSubChannelUnbanRequestResolveEvent };