UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

115 lines (114 loc) 4.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubChannelUnbanRequestResolveEvent = 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 the resolution of an unban request in a channel. */ let EventSubChannelUnbanRequestResolveEvent = class EventSubChannelUnbanRequestResolveEvent extends common_1.DataObject { /** @internal */ constructor(data, client) { super(data); this._client = client; } /** * The ID of the unban request. */ get id() { return this[common_1.rawDataSymbol].id; } /** * The ID of the broadcaster in which channel the unban request was resolved. */ get broadcasterId() { return this[common_1.rawDataSymbol].broadcaster_user_id; } /** * The name of the broadcaster in which channel the unban request was resolved. */ get broadcasterName() { return this[common_1.rawDataSymbol].broadcaster_user_login; } /** * The display name of the broadcaster in which channel the unban request was resolved. */ get broadcasterDisplayName() { return this[common_1.rawDataSymbol].broadcaster_user_name; } /** * Gets more information about the broadcaster in which channel the unban request was resolved. */ async getBroadcaster() { return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_user_id)); } /** * The ID of the moderator that resolved the unban request. */ get moderatorId() { return this[common_1.rawDataSymbol].moderator_user_id; } /** * The name of the moderator that resolved the unban request. */ get moderatorName() { return this[common_1.rawDataSymbol].moderator_user_login; } /** * The display name of the moderator that resolved the unban request. */ get moderatorDisplayName() { return this[common_1.rawDataSymbol].moderator_user_name; } /** * Gets more information about the moderator that resolved the unban request. */ async getModerator() { return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].moderator_user_id)); } /** * The ID of the user that requested to be unbanned. */ get userId() { return this[common_1.rawDataSymbol].user_id; } /** * The name of the user that requested to be unbanned. */ get userName() { return this[common_1.rawDataSymbol].user_login; } /** * The display name of the user that requested to be unbanned. */ get userDisplayName() { return this[common_1.rawDataSymbol].user_name; } /** * Gets more information about the user that requested to be unbanned. */ async getUser() { return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id)); } /** * The message supplied by the mod/broadcaster upon resolution of the request. */ get resolutionMessage() { var _a; return (_a = this[common_1.rawDataSymbol].resolution_text) !== null && _a !== void 0 ? _a : null; } /** * The status of the resolved unban request. */ get status() { return this[common_1.rawDataSymbol].status; } }; exports.EventSubChannelUnbanRequestResolveEvent = EventSubChannelUnbanRequestResolveEvent; tslib_1.__decorate([ (0, shared_utils_1.Enumerable)(false) ], EventSubChannelUnbanRequestResolveEvent.prototype, "_client", void 0); exports.EventSubChannelUnbanRequestResolveEvent = EventSubChannelUnbanRequestResolveEvent = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubChannelUnbanRequestResolveEvent', 'id') ], EventSubChannelUnbanRequestResolveEvent);