From 84870e7e9e8b417c0d49386e59ad2cc38194f15c Mon Sep 17 00:00:00 2001 From: KillerBossOriginal Date: Fri, 8 Dec 2023 16:21:33 +0100 Subject: [PATCH] [NW] IA verification --- src/CreditsManager.ts | 2 +- src/IAManager.ts | 4 ++++ src/index.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CreditsManager.ts b/src/CreditsManager.ts index d6f2a75..857a650 100644 --- a/src/CreditsManager.ts +++ b/src/CreditsManager.ts @@ -22,7 +22,7 @@ export default class CreditsManager { } /** - * Sets the ID for the function. + * Sets the number of credits for a given user. * * @param {number} id - The ID to set. * @return {Promise} - The credits of the user. diff --git a/src/IAManager.ts b/src/IAManager.ts index 8271f36..27f83e0 100644 --- a/src/IAManager.ts +++ b/src/IAManager.ts @@ -14,4 +14,8 @@ export default class IAManager { if (req.status == 404) throw new Error("User not Found"); return req.data; } + + async verify(code: number, identifier: any) { + await axios.post(`${this.URL}/IA/verify/${code}`, { "identifier": "" }); + } } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 3b67076..e29ffd9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,7 @@ export default class TNC extends EventEmitter { }); socket.on("discord_verification", (data) => { let d = JSON.parse(JSON.stringify(data)); - this.emit("discord_verification", d.id); + this.emit("discord_verification", d.id, d.code); }); } } \ No newline at end of file