From 01ed4648738336acea058c464d429d2459253b14 Mon Sep 17 00:00:00 2001 From: Whipstickgostop <8366326+Whipstickgostop@users.noreply.github.com> Date: Tue, 8 Oct 2024 17:01:46 -0400 Subject: [PATCH] feat: populate version property on client instance --- packages/client/src/ws/StreamerbotClient.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/client/src/ws/StreamerbotClient.ts b/packages/client/src/ws/StreamerbotClient.ts index 748f370..39df8d5 100644 --- a/packages/client/src/ws/StreamerbotClient.ts +++ b/packages/client/src/ws/StreamerbotClient.ts @@ -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; @@ -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);