diff --git a/apps/docs/content/2.guide/2.custom-events.md b/apps/docs/content/2.guide/2.custom-events.md index b5dbf56..979593b 100644 --- a/apps/docs/content/2.guide/2.custom-events.md +++ b/apps/docs/content/2.guide/2.custom-events.md @@ -41,30 +41,9 @@ CPH.WebsocketBroadcastJson(json); On the client side, we will handle these events with the following event handler: ```ts [example.ts] -await client.on('General.Custom', (data) => { - if (data.event === 'mediaPlayer' && data.action === 'pause') { +await client.on('General.Custom', (payload) => { + if (payload.data.event === 'mediaPlayer' && payload.data.action === 'pause') { // handle media player pause events in here :) } }); ``` - -## Warning - -::callout{icon=i-mdi-alert color=amber} -**BREAKING** bug in Streamer.bot versions < `v0.2.3` -:: -Until Streamer.bot `v0.2.3` enters `beta` or `stable`, you will have to use a workaround to handle custom events: - -```ts -const client = new StreamerbotClient({ - subscribe: { - General: ['Custom'] - }, - onData: (data) => { - if (data.event && data.event.source === 'None' && data.event.type === 'Custom') { - const payload = data.data; - // handle your custom event in here - } - } -}) -``` \ No newline at end of file