Skip to content

Commit

Permalink
add EventSubStreamOnlineEvent#getStream
Browse files Browse the repository at this point in the history
  • Loading branch information
d-fischer committed Jun 20, 2021
1 parent 571a1d6 commit 53de3e5
Showing 1 changed file with 8 additions and 1 deletion.
@@ -1,5 +1,5 @@
import { Enumerable } from '@d-fischer/shared-utils';
import type { ApiClient, HelixUser } from 'twitch';
import type { ApiClient, HelixStream, HelixUser } from 'twitch';
import { rtfm } from 'twitch-common';

type EventSubStreamOnlineEventStreamType = 'live' | 'playlist' | 'watch_party' | 'premiere' | 'rerun';
Expand Down Expand Up @@ -56,6 +56,13 @@ export class EventSubStreamOnlineEvent {
return (await this._client.helix.users.getUserById(this._data.broadcaster_user_id))!;
}

/**
* Retrieves more information about the stream.
*/
async getStream(): Promise<HelixStream> {
return (await this._client.helix.streams.getStreamByUserId(this._data.broadcaster_user_id))!;
}

/**
* The type of the stream going live.
*/
Expand Down

0 comments on commit 53de3e5

Please sign in to comment.