From 6cca0e989063bebadbdb835a10157581a26699f3 Mon Sep 17 00:00:00 2001 From: KillerBossOriginal Date: Tue, 5 Dec 2023 18:59:53 +0100 Subject: [PATCH] Modified event name, fix, no more console log --- package.json | 2 +- src/index.ts | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 55d1e91..aac401c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tn-api.js", - "version": "0.0.1", + "version": "0.0.2", "description": "A Public Template for npm", "main": "build/index.js", "repository": "https://source.thundernetwork.org/ThunderNetworkRaD/tn-api.js", diff --git a/src/index.ts b/src/index.ts index e22ad92..f605b8b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,20 +32,17 @@ export default class TNC extends EventEmitter { connect() { const socket = io(this.URL); socket.on("connect", () => { - console.log(socket.id); this.id = socket.id; }); socket.on("verify", () => { - console.log("send verification") socket.emit("verify", this.token); }); socket.on("ready", (data) => { - console.log(`Logged in as ${data}`); - this.emit("ready"); + this.emit("ready", data); }); - - socket.on("event", (data) => { - this.emit(data); + socket.on("DISCORD_VERIFICATION", (data) => { + let d = JSON.parse(JSON.stringify(data)); + this.emit("DISCORD_VERIFICATION", d.id); }); } } \ No newline at end of file