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",
|
"name": "tn-api.js",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"description": "A Public Template for npm",
|
"description": "A Public Template for npm",
|
||||||
"main": "build/index.js",
|
"main": "build/index.js",
|
||||||
"repository": "https://source.thundernetwork.org/ThunderNetworkRaD/tn-api.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() {
|
connect() {
|
||||||
const socket = io(this.URL);
|
const socket = io(this.URL);
|
||||||
socket.on("connect", () => {
|
socket.on("connect", () => {
|
||||||
console.log(socket.id);
|
|
||||||
this.id = socket.id;
|
this.id = socket.id;
|
||||||
});
|
});
|
||||||
socket.on("verify", () => {
|
socket.on("verify", () => {
|
||||||
console.log("send verification")
|
|
||||||
socket.emit("verify", this.token);
|
socket.emit("verify", this.token);
|
||||||
});
|
});
|
||||||
socket.on("ready", (data) => {
|
socket.on("ready", (data) => {
|
||||||
console.log(`Logged in as ${data}`);
|
this.emit("ready", data);
|
||||||
this.emit("ready");
|
|
||||||
});
|
});
|
||||||
|
socket.on("DISCORD_VERIFICATION", (data) => {
|
||||||
socket.on("event", (data) => {
|
let d = JSON.parse(JSON.stringify(data));
|
||||||
this.emit(data);
|
this.emit("DISCORD_VERIFICATION", d.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue