twitcheasy-twitch-bottwitch-authtwitch-auth-tmitwitch-chat-clienttwitch-eventsubtwitch-pubsub-clienttwitch-webhooks
Welcome

User

A Twitch user.

Overview

Properties

bio

Type: string

The bio of the user.

creationDate

Type: Date

The date when the user was created, i.e. when they registered on Twitch.

displayName

Type: string

The display name of the user.

id

Type: string

The ID of the user.

logoUrl

Type: string

The URL to the profile picture of the user.

name

Type: string

The name of the user.

type

Type: string

The type of the user.

updateDate

Type: Date

The last date when the user changed anything in their profile, e.g. their description or their profile picture.

Methods

follow()

async

Follows the channel with the authenticated user.

Return type: UserFollow

follows(channel)

async

Checks whether the user is following the given channel.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel to check for the user's follow.

Return type: boolean

getChannel()

async

Retrieves the channel data of the user.

Return type: Channel

getChannelPlaceholder()

Gets a channel placeholder object for the user, which can do anything you can do to a channel with just the ID.

Return type: ChannelPlaceholder

getEmotes()

async

Retrieves the emotes the user can use.

Return type: EmoteSetList

getFollows(page, limit, orderBy, orderDirection)

async

Retrieves a list of channels followed by the user.

Parameter Type Required Default Description
page number none

The result page you want to retrieve.

limit number none

The number of results you want to retrieve.

orderBy "created_at" | "last_broadcast" | "login" none

The field to order by.

orderDirection "asc" | "desc" none

The direction to order in - ascending or descending.

Return type: Array<UserFollow>

getFollowTo(channel)

async

Retrieves the follow data of the user to a given channel.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel to retrieve the follow data for.

Return type: UserFollow | null

getStream()

async

Retrieves the currently running stream of the user.

Return type: Stream | null

getSubscriptionTo(channel)

async

Retrieves the subscription data for the user to the given channel.

Throws if the channel doesn't have a subscription program or the user is not subscribed to it.

This method requires access to the user. If you only have access to the channel, use ChannelPlaceholder#getSubscriptionBy instead.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel you want to get the subscription data for.

Return type: UserSubscription | null

isSubscribedTo(channel)

async

Checks whether the user is subscribed to the given channel.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel you want to check the subscription for.

Return type: boolean

unfollow()

async

Unfollows the channel with the authenticated user.

Return type: void