Modified event name, fix, no more console log
This commit is contained in:
parent
03fd434ee5
commit
6cca0e9890
2 changed files with 5 additions and 8 deletions
|
@ -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",
|
||||
|
|
11
src/index.ts
11
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);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue