diff --git a/JS-SDK/package.json b/JS-SDK/package.json index 78ea89b..040c5c1 100644 --- a/JS-SDK/package.json +++ b/JS-SDK/package.json @@ -1,6 +1,6 @@ { "name": "usetether", - "version": "1.1.0", + "version": "1.1.1", "author": "Braydon (Rainnny) ", "description": "An API designed to provide real-time access to a user's Discord data.", "keywords": [ diff --git a/JS-SDK/src/hook/websocket.ts b/JS-SDK/src/hook/websocket.ts index 6e29d73..93d7660 100644 --- a/JS-SDK/src/hook/websocket.ts +++ b/JS-SDK/src/hook/websocket.ts @@ -1,7 +1,6 @@ import { useEffect, useState } from "react"; import { Snowflake } from "@/types/snowflake"; import { TetherConfig } from "@/types/config"; -import { DiscordUser } from "@/types/user"; export const useTetherWS = ( snowflake: Snowflake, @@ -9,8 +8,8 @@ export const useTetherWS = ( endpoint: "usetether.rest", secure: true, } -): DiscordUser | undefined => { - const [user] = useState(); +): Snowflake => { + const [user] = useState(snowflake); const url: string = `ws${secure && "s"}://${endpoint}/gateway`; useEffect(() => { @@ -24,6 +23,7 @@ export const useTetherWS = ( * Establish a connection with the API. */ function connect() { + console.log("connecting to:", url); socket = new WebSocket("wss://usetether.rest/gateway"); // Connect to the gateway socket.addEventListener("open", () => console.log("[Tether] WebSocket connection established!")