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