mirror of
https://github.com/DerTyp7/obs-twitch-camera-frame.git
synced 2025-10-29 04:42:13 +01:00
26 lines
586 B
JavaScript
26 lines
586 B
JavaScript
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) => {
|
|
console.log(data);
|
|
if (data.event.type == "subscription") {
|
|
sub(data.event.parameters.username);
|
|
}
|
|
});
|
|
}
|
|
});
|