Modified event name, fix, no more console log

This commit is contained in:
KillerBossOriginal 2023-12-05 18:59:53 +01:00
parent 03fd434ee5
commit 6cca0e9890
2 changed files with 5 additions and 8 deletions

View file

@ -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",

View file

@ -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);
});
}
}