Channel
| Function | Returns |
|---|---|
getChannelInfoById | Promise<Channel | null> |
getChannelInfoByIdBatched | Promise<Channel | null> |
getChannelInfoByIds | Promise<Array<Channel>> |
updateChannelInfo | Promise<void> |
startChannelCommercial | Promise<void> |
getChannelEditors | Promise<Array<ChannelEditor>> |
getVips | Promise<PaginatedResult<UserRelation>> |
checkVipForUsers | Promise<Array<UserRelation>> |
checkVipForUser | Promise<boolean> |
addVip | Promise<void> |
removeVip | Promise<void> |
getChannelFollowerCount | Promise<number> |
getChannelFollowers | Promise<PaginatedResultWithTotal<ChannelFollower>> |
getFollowedChannels | Promise<PaginatedResultWithTotal<FollowedChannel>> |
getAdSchedule | Promise<AdSchedule> |
snoozeNextAd | Promise<SnoozeNextAd> |
Functions
getChannelInfoById
twitch.channel.getChannelInfoById(userId: UserIdResolvable): Promise<Channel | null>
getChannelInfoByIdBatched
twitch.channel.getChannelInfoByIdBatched(userId: UserIdResolvable): Promise<Channel | null>
getChannelInfoByIds
twitch.channel.getChannelInfoByIds(userIds: Array<UserIdResolvable>): Promise<Array<Channel>>
updateChannelInfo
twitch.channel.updateChannelInfo(userId: UserIdResolvable, data: ChannelUpdate): Promise<void>
startChannelCommercial
twitch.channel.startChannelCommercial(length: CommercialLength): Promise<void>
getChannelEditors
twitch.channel.getChannelEditors(): Promise<Array<ChannelEditor>>
getVips
twitch.channel.getVips(pagination?: ForwardPagination): Promise<PaginatedResult<UserRelation>>
checkVipForUsers
twitch.channel.checkVipForUsers(userIds: Array<UserIdResolvable>): Promise<Array<UserRelation>>
checkVipForUser
twitch.channel.checkVipForUser(userId: UserIdResolvable): Promise<boolean>
addVip
twitch.channel.addVip(userId: UserIdResolvable): Promise<void>
removeVip
twitch.channel.removeVip(userId: UserIdResolvable): Promise<void>
getChannelFollowerCount
twitch.channel.getChannelFollowerCount(): Promise<number>
getChannelFollowers
twitch.channel.getChannelFollowers(userId?: UserIdResolvable, pagination?: ForwardPagination): Promise<PaginatedResultWithTotal<ChannelFollower>>
getFollowedChannels
twitch.channel.getFollowedChannels(userId: UserIdResolvable, broadcasterId?: UserIdResolvable, pagination?: ForwardPagination): Promise<PaginatedResultWithTotal<FollowedChannel>>
getAdSchedule
twitch.channel.getAdSchedule(): Promise<AdSchedule>
snoozeNextAd
twitch.channel.snoozeNextAd(): Promise<SnoozeNextAd>
Types
AdSchedule
type AdSchedule = {
snoozeCount: number
snoozeRefreshAt: number
nextAdAt: number
duration: number
lastAdAt: number
prerollFreeTime: number
}
Channel
type Channel = {
broadcasterId: string
broadcasterLogin: string
broadcasterName: string
broadcasterLanguage: string
gameId: string
gameName: string
title: string
delay: number
tags: Array<string>
contentClassificationLabels: Array<string>
isBrandedContent: boolean
}
ChannelEditor
type ChannelEditor = {
userId: string
userName: string
createdAt: string
}
ChannelFollower
type ChannelFollower = {
userId: string
userLogin: string
userName: string
followedAt: string
}
ChannelUpdate
type ChannelUpdate = {
language?: string
gameId?: string
title?: string
delay?: number
tags?: Array<string>
contentClassificationLabels?: Array<string>
isBrandedContent?: boolean
}
CommercialLength
type CommercialLength = 30 | 60 | 90 | 120 | 150 | 180
FollowedChannel
type FollowedChannel = {
broadcasterId: string
broadcasterLogin: string
broadcasterName: string
followedAt: string
}
ForwardPagination
type ForwardPagination = {
limit?: number
after?: string
}
PaginatedResult
type PaginatedResult<T> = {
data: Array<T>
cursor?: string
}
PaginatedResultWithTotal
type PaginatedResultWithTotal<T> = {
data: Array<T>
cursor: string
total: number
}
SnoozeNextAd
type SnoozeNextAd = {
snoozeCount: number
snoozeRefreshAt: number
nextAdAt: number
}
UserIdResolvable
type UserIdResolvable = string | UserIdResolvableType
UserIdResolvableType
type UserIdResolvableType = {
id: string
}
UserRelation
type UserRelation = {
userId: string
userLogin: string
userName: string
}