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

PrivilegedUser

A user you have extended privileges for, i.e. the currently authenticated 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.

email

Type: string

The user's email address.

hasEmailNotifications

Type: boolean

Whether the user has email notifications enabled.

hasPushNotifications

Type: boolean

Whether the user has push notifications enabled.

hasTwitter

Type: boolean

Whether the user has a Twitter account connected.

id

Type: string

The ID of the user.

isEmailVerified

Type: boolean

Whether the user's email address is verified.

isPartnered

Type: boolean

Whether the user is partnered.

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

blockUser(userToBlock)

async

Blocks a user.

Parameter Type Required Default Description
userToBlock UserIdResolvable none

The user to block.

Return type: UserBlock

follow()

async

Follows the channel with the authenticated user.

Return type: UserFollow

followChannel(channel, notifications)

async

Follows a channel.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel to follow.

notifications boolean none

Whether the user will receive notifications.

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

unblockUser(userToUnblock)

async

Unblocks a user.

Parameter Type Required Default Description
userToUnblock UserIdResolvable none

The user to unblock.

Return type: void

unfollow()

async

Unfollows the channel with the authenticated user.

Return type: void

unfollowChannel(channel)

async

Unfollows a channel.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel to unfollow.

Return type: void