You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 27, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: src/lib/gif.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -27,13 +27,15 @@ class GIF {
27
27
/**
28
28
* Returns a random GIF image of the type provided.
29
29
* @param {string} type - The Type of GIF. See https://weebyapi.xyz/api/docs#gif for all the GIFs.
30
+
* @param {string} noanime - EXPERIMENT - IT MAY GET REMOVED: If the GIF should not be anime.
30
31
* @returns {Promise<string>} The Formatted GIF URL.
31
32
*/
32
-
asyncfetch(type){
33
+
asyncfetch(type,noanime=''){
33
34
if(typeoftype!=='string')thrownewError(`${chalk.magenta('Weeby-JS')}${chalk.gray('»')}${chalk.yellow('The Type parameter is not a string.')}`);
34
35
if(!type)thrownewError(`${chalk.magenta('Weeby-JS')}${chalk.gray('»')}${chalk.yellow('Type parameter is missing. You will need to provide the type of GIF.')}`);
36
+
if(noanime&&typeofnoanime!=='boolean')thrownewError(`${chalk.magenta('Weeby-JS')}${chalk.gray('»')}${chalk.yellow('The No Anime parameter is not a boolean.')}`);
35
37
36
-
const{ body }=awaitget(`${this.baseURL}/${type}`)
38
+
const{ body }=awaitget(`${this.baseURL}/${type}?noanime=${noanime}`)
37
39
.set('Authorization',`Bearer ${this.token}`)
38
40
.set('User-Agent',`Weeby-JS by NTM Development » v${version}`);
0 commit comments