UNPKG

@twurple/api

Version:

Interact with Twitch's API.

45 lines (44 loc) 1.19 kB
import { __decorate } from "tslib"; import { Enumerable } from '@d-fischer/shared-utils'; import { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common'; /** * A user connected to a Twitch channel's chat session. */ let HelixChatChatter = class HelixChatChatter extends DataObject { /** @internal */ constructor(data, client) { super(data); this._client = client; } /** * The ID of the user. */ get userId() { return this[rawDataSymbol].user_id; } /** * The name of the user. */ get userName() { return this[rawDataSymbol].user_login; } /** * The display name of the user. */ get userDisplayName() { return this[rawDataSymbol].user_name; } /** * Gets more information about the user. */ async getUser() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id)); } }; __decorate([ Enumerable(false) ], HelixChatChatter.prototype, "_client", void 0); HelixChatChatter = __decorate([ rtfm('api', 'HelixChatChatter') ], HelixChatChatter); export { HelixChatChatter };