Skip to content

Commit

Permalink
feat: populate version property on client instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Whipstickgostop committed Oct 8, 2024
1 parent d25a753 commit 01ed464
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/client/src/ws/StreamerbotClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class StreamerbotClient {
private readonly options: StreamerbotClientOptions;

protected socket?: WebSocket;
protected version?: string;
protected listeners: Array<{
events: StreamerbotEventName[];
callback: (data: any) => void;
Expand Down Expand Up @@ -217,6 +218,7 @@ export class StreamerbotClient {
const infoResponse = await this.getInfo();
if (infoResponse.status !== 'ok') throw new Error('Failed to fetch Streamer.bot instance information');

this.version = infoResponse.info.version;
this?.options?.onConnect?.(infoResponse.info);
} catch (e) {
console.error('Error invoking onOpen handler', e);
Expand Down

0 comments on commit 01ed464

Please sign in to comment.