diff --git a/package.json b/package.json index fc74781..caa7720 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vacefron", - "version": "3.0.0", + "version": "3.1.0", "description": "A wrapper for the VACEfron API in TypeScript.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 526bb4c..9cd01d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,8 +30,7 @@ export class VACEFronJS { } } - // @ts-ignore - const params = new URLSearchParams(parameters); + const params = new URLSearchParams((parameters as URLSearchParams)); const response = await fetch(`${this.baseURL}/${endpoint}?${params}`); if (response.status !== 200) { @@ -150,6 +149,15 @@ export class VACEFronJS { return this.api('heaven', { user: avatarURL }); } + /** + * Makes a request for the NPC meme. + * @param text1 - The first text parameter. + * @param text2 - The second text parameter. + */ + public npc(text1: string, text2: string): Promise { + return this.api('npc', { text1, text2 }) + } + /** * Makes a request for a rankcard. * @param username - The username of the user levelling up. diff --git a/tsconfig.json b/tsconfig.json index 37cbc46..f9fce0e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,8 @@ "moduleResolution": "node", "target": "esnext", "lib": [ - "esnext" + "esnext", + "dom" ], "declaration": true, "removeComments": false,