mirror of
https://github.com/DerTyp7/obs-twitch-camera-frame.git
synced 2025-10-29 21:02:14 +01:00
first commit
This commit is contained in:
24
js/socket.js
Normal file
24
js/socket.js
Normal file
@@ -0,0 +1,24 @@
|
||||
fetch("https://api.tipeeestream.com/v2.0/site/socket")
|
||||
.then((res) => res.json())
|
||||
.then((json) => {
|
||||
if (json.code == 200) {
|
||||
const socket = io(`${json.datas.host}:${json.datas.port}`, {
|
||||
query: {
|
||||
access_token: CONFIG.apiKey,
|
||||
},
|
||||
});
|
||||
|
||||
socket.on("connect", () => {
|
||||
console.log("Connected");
|
||||
socket.emit("join-room", {
|
||||
room: CONFIG.apiKey,
|
||||
username: "DerTyp876",
|
||||
});
|
||||
});
|
||||
socket.on("new-event", (data) => {
|
||||
if (data.event.type == "subscription") {
|
||||
sub(data.event.parameters.username);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user