Skip to main content

Subscription

popyt


popyt / Library Exports / Subscription

Class: Subscription

Defined in: entities/subscription.ts:9

A YouTube subscription.

Constructors​

Constructor​

new Subscription(youtube, data, full?): Subscription

Defined in: entities/subscription.ts:139

Parameters​

youtube​

YouTube

data​

Schema$Subscription

full?​

boolean = true

Returns​

Subscription

Properties​

activities​

activities: "all" | "uploads"

Defined in: entities/subscription.ts:137

The activities that the user has subscribed to.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600


channel​

channel: object

Defined in: entities/subscription.ts:56

Information on the Channel that the user subscribed to.

id​

id: string

The ID of the channel.

name​

name: string

The name of the channel.


data​

data: any

Defined in: entities/subscription.ts:41

The raw data of this subscription.


dateSubscribed​

dateSubscribed: Date

Defined in: entities/subscription.ts:51

The date that the user subscribed to the channel on.


description​

description: string

Defined in: entities/subscription.ts:76

The details of the subscription.


full​

full: boolean = true

Defined in: entities/subscription.ts:36

Whether or not this is a full subscription object.


id​

id: string

Defined in: entities/subscription.ts:46

The ID of this subscription.


items​

items: object

Defined in: entities/subscription.ts:121

Statistics on the items that the subscription points to.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600

new​

new: number

The number of new items in the subscription.

total​

total: number

The total number of items that the subscription points to.


subscriber​

subscriber: object

Defined in: entities/subscription.ts:82

Information on the user that subscribed to the channel.
CURRENTLY NOT WORKING, see https://issuetracker.google.com/issues/181152600

description?​

optional description?: string

The user's description.

id​

id: string

The user's ID.

name?​

optional name?: string

The user's username.

thumbnails?​

optional thumbnails?: object

Thumbnail images for the user's channel.

thumbnails.default?​

optional default?: Thumbnail

thumbnails.high?​

optional high?: Thumbnail

thumbnails.medium?​

optional medium?: Thumbnail


thumbnails​

thumbnails: object

Defined in: entities/subscription.ts:111

Thumbnail images for the subscription.

default?​

optional default?: Thumbnail

high?​

optional high?: Thumbnail

medium?​

optional medium?: Thumbnail


title​

title: string

Defined in: entities/subscription.ts:71

The title of the subscription.


youtube​

youtube: YouTube

Defined in: entities/subscription.ts:31

The YouTube object that created this subscription object.


endpoint​

static endpoint: string = 'subscriptions'

Defined in: entities/subscription.ts:13

The name of the endpoint used for this entity.


fields​

static fields: string

Defined in: entities/subscription.ts:23

The fields to request for this entity.


part​

static part: string = 'contentDetails,snippet,subscriberSnippet'

Defined in: entities/subscription.ts:18

The parts to request for this entity.

Methods​

fetch()​

fetch(parts?): Promise<Subscription>

Defined in: entities/subscription.ts:194

Fetches this subscription from the API and reassigns this object to the new subscription object. Only useful if this.full is false, or if you want updated subscription info.
CURRENTLY NOT WORKING unless the subscriber and channel properties are populated, see https://issuetracker.google.com/issues/288609601

Parameters​

parts?​

SubscriptionParts

Returns​

Promise<Subscription>


getChannel()​

getChannel(parts?): Promise<Channel>

Defined in: entities/subscription.ts:207

Parameters​

parts?​

ChannelParts

Returns​

Promise<Channel>


getSubscriber()​

getSubscriber(parts?): Promise<Channel>

Defined in: entities/subscription.ts:212

Parameters​

parts?​

ChannelParts

Returns​

Promise<Channel>