From 22af32adc2884bfe571af598dfb91f2e71a2a538 Mon Sep 17 00:00:00 2001 From: choelzl Date: Sun, 6 Feb 2022 21:02:09 +0100 Subject: [PATCH] WIP --- twitch/customOverlay.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/twitch/customOverlay.js b/twitch/customOverlay.js index 67271c2..52d239b 100644 --- a/twitch/customOverlay.js +++ b/twitch/customOverlay.js @@ -9,6 +9,10 @@ })); } + // $.inidb.get('streamInfo', 'lastSub', subscriber); + // $.inidb.get('streamInfo', 'lastFollow', follower); + // $.inidb.get('streamInfo', 'lastDonator', donationUsername); + $.bind('command', function(event) { const sender = "" + event.getSender().toLowerCase(), @@ -43,5 +47,17 @@ $.registerChatSubcommand('overlay', 'timer', 2); }); + $(document).ready(async ()=>{ + if(socket){ + while(socket.getReadyState() === 0){ + await new Promise(r => setTimeout(r, 500)); + } + socket.getDBValue("get_current_stream_info", 'streamInfo', 'lastSub', function(response) { + console.log(response); + + if(response.request_data) console.log(response.request_data) + }) + } + }) })(); \ No newline at end of file