memer-api
Advanced tools
Comparing version 3.0.6 to 4.0.0
933
lib/Meme.js
@@ -1,22 +0,52 @@ | ||
const base = "https://memerapi.cf"; | ||
const base = "http://memer-api.live/api/v4"; | ||
const fetch = require('node-fetch') | ||
const fetch = require('snekfetch') | ||
/** | ||
* Mmemer API Memes Generator | ||
* @example const Meme = require("memer-api"); | ||
* const memer = new Meme('Your Cool API Token'); | ||
* | ||
* memer.youtube("./image.png", "Memer API", "A Youtube Comment") | ||
* .then(youtube => { | ||
* const attachment = new Discord.MessageAttachment(youtube, "youtube.png"); | ||
* }) | ||
*/ | ||
class Meme { | ||
class Meme { | ||
constructor(token) { | ||
if (!token) throw new TypeError("Token was not provided!"); | ||
if (!token) throw new TypeError('Memer API Token was not provided!'); | ||
this.token = token; | ||
} | ||
/** | ||
* savehumanity | ||
* @param {String} text text to generate meme | ||
*/ | ||
* Sends a random anime quote. | ||
* @returns {json} | ||
*/ | ||
animequotes() { | ||
savehumanity(text) { | ||
return new Promise((resolve, reject) => { | ||
fetch(encodeURI(`${base}/animequote?token=${this.token}`)).then(async data => { | ||
//send data back | ||
let quote = await data.json() | ||
resolve(quote) | ||
return; | ||
}).catch(error => { | ||
//if error reject the error | ||
reject(error) | ||
}) | ||
}) | ||
} | ||
/** | ||
* Generates a Meme on SaveHumanity. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async savehumanity(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/savehumanity?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/savehumanity?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -29,14 +59,35 @@ }).catch(error => { | ||
} | ||
/** | ||
* stonks | ||
* @param {String} text text to generate meme | ||
*/ | ||
* Generates a Meme on Stonks. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async stonks(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
stonks(text) { | ||
return new Promise((resolve, reject) => { | ||
fetch(encodeURI(`${base}/stonks?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.buffer()) | ||
return; | ||
}).catch(error => { | ||
//if error reject the error | ||
reject(error) | ||
}) | ||
}) | ||
} | ||
/** | ||
* Generates a Meme on abandon. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async abandon(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/stonks?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/abandon?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -49,14 +100,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* notstonks | ||
* @param {String} text text to generate meme | ||
* Generates a Meme on NotStonks. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
notstonks(text) { | ||
async notstonks(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/notstonks?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/notstonks?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -69,14 +121,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* piccolo | ||
* @param {String} text text to generate meme | ||
*/ | ||
piccolo(text) { | ||
* Generates a Meme on Piccolo. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async piccolo(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/piccolo?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/piccolo?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -89,14 +142,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* tornado | ||
* @param {String} text text to generate meme | ||
*/ | ||
tornado(text, text2) { | ||
* Generates a Meme on Tornado. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async tornado(text, text2) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
if (!text2) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/tornado?text=${text}&text2=${text2}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/tornado?text=${text}&text2=${text2}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -109,14 +163,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* ohno | ||
* @param {String} text text to generate meme | ||
*/ | ||
ohno(text) { | ||
* Generates a Meme on . | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async ohno(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/ohno?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/ohno?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -129,14 +184,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* drake | ||
* @param {String} text text to generate meme | ||
*/ | ||
drake(text) { | ||
* Generates a Meme on Drake. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async drake(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/drake?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/drake?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -149,14 +205,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* abandon | ||
* @param {String} text text to generate meme | ||
*/ | ||
abandon(text) { | ||
* Generates a Meme on . | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async abandon(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/abandon?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/abandon?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -169,14 +226,16 @@ }).catch(error => { | ||
} | ||
/** | ||
* pepesign | ||
* @param {String} text text to generate meme | ||
*/ | ||
pepesign(text) { | ||
* Generates a Meme on PepeSign. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async pepesign(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/pepesign?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/pepesign?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -189,13 +248,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* vr | ||
* @param {String} text text to generate meme | ||
* Generates a Meme on VR. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
vr(text) { | ||
async vr(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/vr?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/vr?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
console.log(data.body) | ||
@@ -209,13 +270,15 @@ return; | ||
} | ||
/** | ||
* search | ||
* @param {String} text text to generate meme | ||
* Generates a Meme on Search. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
search(text) { | ||
async search(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/isearch?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/isearch?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -228,14 +291,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* failure | ||
* @param {String} avatar url to generate meme | ||
*/ | ||
failure(avatar) { | ||
* Generates a Meme on Failure. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async failure(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/failure?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/failure?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -250,13 +314,13 @@ }).catch(error => { | ||
/** | ||
* trash | ||
* @param {String} avatar url to generate meme | ||
*/ | ||
trash(avatar) { | ||
* Generates a Meme on Trash. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async trash(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/trash?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/trash?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -271,13 +335,13 @@ }).catch(error => { | ||
/** | ||
* satan | ||
* @param {String} avatar url to generate meme | ||
*/ | ||
satan(avatar) { | ||
* Generates a Meme on Satan. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async satan(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/satan?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/satan?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -292,13 +356,13 @@ }).catch(error => { | ||
/** | ||
* stroke | ||
* @param {String} text to generate meme | ||
*/ | ||
stroke(text) { | ||
* Generates a Meme on Stroke. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async stroke(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/stroke?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/stroke?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -313,13 +377,13 @@ }).catch(error => { | ||
/** | ||
* roblox | ||
* @param {String} avatar | ||
*/ | ||
roblox(avatar) { | ||
* Generates a Meme on Roblox. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async roblox(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/roblox?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/roblox?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -334,13 +398,13 @@ }).catch(error => { | ||
/** | ||
* hitler | ||
* @param {String} avatar | ||
*/ | ||
hitler(avatar) { | ||
* Generates a Meme on Hitler. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async hitler(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/hitler?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/hitler?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -355,7 +419,8 @@ }).catch(error => { | ||
/** | ||
* bed | ||
* @param {String} avatar1 avatar1 | ||
*/ | ||
bed(avatar1, avatar2) { | ||
* Generates a Meme on Bed. | ||
* @param {string} avatar Avatar1 URL to Generate meme | ||
* @param {string} avatar Avatar2 URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async bed(avatar1, avatar2) { | ||
if (!avatar1) throw new SyntaxError("You are Missing the first AVATAR") | ||
@@ -365,5 +430,5 @@ if (!avatar2) throw new SyntaxError("You are Missing the second AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/bed?avatars=${avatar1},${avatar2}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/bed?avatars=${avatar1},${avatar2}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -378,13 +443,13 @@ }).catch(error => { | ||
/** | ||
* jail | ||
* @param {String} avatar | ||
*/ | ||
jail(avatar) { | ||
* Generates a Meme on Jail. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async jail(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/jail?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/jail?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -399,13 +464,13 @@ }).catch(error => { | ||
/** | ||
* delete | ||
* @param {String} avatar | ||
*/ | ||
delete(avatar) { | ||
* Generates a Meme on Delete. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async delete(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/delete?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/delete?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -420,13 +485,13 @@ }).catch(error => { | ||
/** | ||
* emergencymeeting | ||
* @param {String} text | ||
*/ | ||
emergencymeeting(text) { | ||
* Generates a Meme on EmergencyMeeting. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async emergencymeeting(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/emergencymeeting?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/emergencymeeting?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -441,9 +506,9 @@ }).catch(error => { | ||
/** | ||
* byemom | ||
* @param {String} avatar | ||
* @param {String} username | ||
* @param {String} text | ||
**/ | ||
byemom(avatar, username, text) { | ||
* Generates a Meme on Byemom. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @param {string} username Username of the user to Generate meme | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async byemom(avatar, username, text) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
@@ -454,5 +519,5 @@ if (!username) throw new SyntaxError("You are Missing the USERNAME") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/byemom?text=${text}&avatars=${avatar}&usernames=${username}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/byemom?text=${text}&avatars=${avatar}&usernames=${username}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -465,9 +530,10 @@ }).catch(error => { | ||
} | ||
/** | ||
* draw25 | ||
* @param {String} avatar | ||
* @param {String} text | ||
**/ | ||
draw25(avatar, text) { | ||
* Generates a Meme on Draw25. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async draw25(avatar, text) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
@@ -477,5 +543,5 @@ if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/draw25?text=${text}&avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/draw25?text=${text}&avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -488,14 +554,15 @@ }).catch(error => { | ||
} | ||
/** | ||
* walking | ||
* @param {String} text | ||
*/ | ||
walking(text) { | ||
* Generates a Meme on Walking. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async walking(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/walking?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/walking?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -510,13 +577,13 @@ }).catch(error => { | ||
/** | ||
* keepdistance | ||
* @param {String} text | ||
*/ | ||
keepdistance(text) { | ||
* Generates a Meme on Keepdistance. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async keepdistance(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/keepdistance?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/keepdistance?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -531,13 +598,13 @@ }).catch(error => { | ||
/** | ||
* fakenews | ||
* @param {String} avatar url | ||
*/ | ||
fakenews(avatar) { | ||
* Generates a Meme on Fakenews. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async fakenews(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/fakenews?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/fakenews?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -552,13 +619,13 @@ }).catch(error => { | ||
/** | ||
* wanted | ||
* @param {String} avatar url | ||
*/ | ||
wanted(avatar) { | ||
* Generates a Meme on Wanted. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async wanted(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/wanted?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/wanted?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -573,13 +640,13 @@ }).catch(error => { | ||
/** | ||
* godwhy | ||
* @param {String} text | ||
*/ | ||
godwhy(text) { | ||
* Generates a Meme on Godwhy. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async godwhy(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/godwhy?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/godwhy?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -594,13 +661,13 @@ }).catch(error => { | ||
/** | ||
* violence | ||
* @param {String} text | ||
*/ | ||
violence(text) { | ||
* Generates a Meme on Violence. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async violence(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/violence?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/violence?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -615,13 +682,13 @@ }).catch(error => { | ||
/** | ||
* ipad | ||
* @param {String} avatar | ||
*/ | ||
ipad(avatar) { | ||
* Generates a Meme on Ipad. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async ipad(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/ipad?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/ipad?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -636,13 +703,13 @@ }).catch(error => { | ||
/** | ||
* laid | ||
* @param {String} avatar url | ||
*/ | ||
laid(avatar) { | ||
* Generates a Meme on Laid. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async laid(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/laid?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/laid?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -657,13 +724,13 @@ }).catch(error => { | ||
/** | ||
* ugly | ||
* @param {String} avatar | ||
*/ | ||
ugly(avatar) { | ||
* Generates a Meme on Ugly. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async ugly(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/ugly?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/ugly?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -678,13 +745,13 @@ }).catch(error => { | ||
/** | ||
* shit | ||
* @param {String} text | ||
*/ | ||
shit(text) { | ||
* Generates a Meme on Shit. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async shit(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/shit?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/shit?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -699,13 +766,13 @@ }).catch(error => { | ||
/** | ||
* humansgood | ||
* @param {String} text | ||
*/ | ||
humansgood(text) { | ||
* Generates a Meme on humansgood. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async humansgood(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/humansgood?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/humansgood?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -720,13 +787,13 @@ }).catch(error => { | ||
/** | ||
* whodidthis | ||
* @param {String} avatar | ||
*/ | ||
whodidthis(avatar) { | ||
* Generates a Meme on whodidthis. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async whodidthis(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/whodidthis?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/whodidthis?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -741,8 +808,8 @@ }).catch(error => { | ||
/** | ||
* floor | ||
* @param {String} avatar | ||
* @param {String} text | ||
*/ | ||
floor(text, avatar) { | ||
* Generates a Meme on Floor. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async floor(text, avatar) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
@@ -752,5 +819,5 @@ if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/floor?text=${text}&avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/floor?text=${text}&avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -765,7 +832,8 @@ }).catch(error => { | ||
/** | ||
* @param {String} avatar | ||
* @param {String} text | ||
*/ | ||
obama(text, avatar) { | ||
* Generates a Meme on Obama. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async obama(text, avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
@@ -775,5 +843,5 @@ if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/obama?text=${text}&avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/obama?text=${text}&avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -788,13 +856,13 @@ }).catch(error => { | ||
/** | ||
* note | ||
* @param {String} text | ||
*/ | ||
note(text) { | ||
* Generates a Meme on Note. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async note(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/note?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/note?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -809,13 +877,13 @@ }).catch(error => { | ||
/** | ||
* airpods | ||
* @param {String} avatar url | ||
*/ | ||
airpods(avatar) { | ||
* Generates a Meme on America. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async america(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/airpods?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/america?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -830,13 +898,13 @@ }).catch(error => { | ||
/** | ||
* america | ||
* @param {String} avatar url | ||
*/ | ||
america(avatar) { | ||
* Generates a Meme on Aborted. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async aborted(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/america?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/aborted?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -851,13 +919,13 @@ }).catch(error => { | ||
/** | ||
* aborted | ||
* @param {String} avatar url | ||
*/ | ||
aborted(avatar) { | ||
* Generates a Meme on Affect. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async affect(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/aborted?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/affect?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -872,33 +940,13 @@ }).catch(error => { | ||
/** | ||
* affect | ||
* @param {String} avatar url | ||
*/ | ||
affect(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/affect?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
return; | ||
}).catch(error => { | ||
//if error reject the error | ||
reject(error) | ||
}) | ||
}) | ||
} | ||
/** | ||
* armor | ||
* @param {String} text | ||
*/ | ||
armor(text) { | ||
* Generates a Meme on Armor. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async armor(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/armor?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/armor?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -913,13 +961,13 @@ }).catch(error => { | ||
/** | ||
* facts | ||
* @param {String} text | ||
*/ | ||
facts(text) { | ||
* Generates a Meme on Facts. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async facts(text) { | ||
if (!text) throw new SyntaxError("You are Missing the TEXT") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/facts?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/facts?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -934,13 +982,13 @@ }).catch(error => { | ||
/** | ||
* bongocat | ||
* @param {String} avatar | ||
*/ | ||
bongocat(avatar) { | ||
* Generates a Meme on Bongocat. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async bongocat(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/bongocat?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/bongocat?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -955,13 +1003,13 @@ }).catch(error => { | ||
/** | ||
* brazzers | ||
* @param {String} avatar | ||
*/ | ||
brazzers(avatar) { | ||
* Generates a Meme on Brazzers. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async brazzers(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/brazzers?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/brazzers?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -976,13 +1024,13 @@ }).catch(error => { | ||
/** | ||
* cancer | ||
* @param {String} avatar url | ||
*/ | ||
cancer(avatar) { | ||
* Generates a Meme on Cancer. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async cancer(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/cancer?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/cancer?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -997,12 +1045,12 @@ }).catch(error => { | ||
/** | ||
* changemymind | ||
* @param {String} text | ||
*/ | ||
* Generates a Meme on Changemymind. | ||
* @param {string} text Text to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async changemymind(text) { | ||
changemymind(text) { | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/changemymind?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/changemymind?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1017,13 +1065,13 @@ }).catch(error => { | ||
/** | ||
* communism | ||
* @param {String} avatar url | ||
*/ | ||
communism(avatar) { | ||
* Generates a Meme on Communism. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async communism(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/communism?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/communism?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1038,13 +1086,13 @@ }).catch(error => { | ||
/** | ||
* corporate | ||
* @param {String} avatar url | ||
*/ | ||
corporate(avatar) { | ||
* Generates a Meme on Corporate. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async corporate(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/corporate?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/corporate?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1059,13 +1107,13 @@ }).catch(error => { | ||
/** | ||
* cry | ||
* @param {String} text | ||
*/ | ||
cry(text) { | ||
* Generates a Meme on Cry. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async cry(text) { | ||
if (!text) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/cry?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/cry?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1080,13 +1128,13 @@ }).catch(error => { | ||
/** | ||
* dab | ||
* @param {String} avatar url | ||
*/ | ||
dab(avatar) { | ||
* Generates a Meme on Dab. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async dab(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/dab?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/dab?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1101,13 +1149,13 @@ }).catch(error => { | ||
/** | ||
* disability | ||
* @param {String} avatar url | ||
*/ | ||
disability(avatar) { | ||
* Generates a Meme on Disability. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async disability(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/disability?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/disability?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1122,13 +1170,13 @@ }).catch(error => { | ||
/** | ||
* door | ||
* @param {String} avatar url | ||
*/ | ||
door(avatar) { | ||
* Generates a Meme on Door. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async door(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/door?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/door?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1143,13 +1191,13 @@ }).catch(error => { | ||
/** | ||
* egg | ||
* @param {String} avatar url | ||
*/ | ||
egg(avatar) { | ||
* Generates a Meme on Egg. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async egg(avatar) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/egg?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/egg?avatars=${avatar}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1164,13 +1212,13 @@ }).catch(error => { | ||
/** | ||
* excuseme | ||
* @param {String} text | ||
*/ | ||
excuseme(text) { | ||
* Generates a Meme on Excuseme. | ||
* @param {string} avatar Avatar URL to Generate meme | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async excuseme(text) { | ||
if (!text) throw new SyntaxError("You are Missing the AVATAR") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/excuseme?text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/excuseme?text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1183,10 +1231,11 @@ }).catch(error => { | ||
} | ||
/** | ||
* youtube | ||
* @param {String} avatar | ||
* @param {String} username | ||
* @param {String} text | ||
* Generates a Youtube Comment. | ||
* @param {string} avatar Avatar URL to Generate youtube comment | ||
* @param {string} username Username of the user to Generate youtube comment | ||
* @param {string} text Text to Generate youtube comment | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
youtube(avatar, username, text) { | ||
async youtube(avatar, username, text) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
@@ -1197,5 +1246,5 @@ if (!username) throw new SyntaxError("You are Missing the USERNAME") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/youtube?avatars=${avatar}&usernames=${username}&text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/youtube?avatars=${avatar}&usernames=${username}&text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1208,10 +1257,11 @@ }).catch(error => { | ||
} | ||
/** | ||
* welcome | ||
* @param {String} avatar | ||
* @param {String} username | ||
* @param {String} background | ||
* Generates a Meme on Welcome. | ||
* @param {string} avatar Avatar URL to Generate welcome image | ||
* @param {string} username Username of the user to Generate welcome image | ||
* @param {string} background Background URL to Generate welcome image | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
welcome(username, avatar, background) { | ||
async welcome(username, avatar, background) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
@@ -1221,5 +1271,5 @@ if (!username) throw new SyntaxError("You are Missing the USERNAME") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/welcomeimage?av=${avatar}&usernames=${username}&background=${background}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/welcomeimage?av=${avatar}&usernames=${username}&background=${background}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1232,10 +1282,11 @@ }).catch(error => { | ||
} | ||
/** | ||
* leave | ||
* @param {String} avatar | ||
* @param {String} username | ||
* @param {String} background | ||
*/ | ||
leave(username, avatar, background) { | ||
* Generates a Meme on Leave. | ||
* @param {string} avatar Avatar URL to Generate leave image | ||
* @param {string} username Username of the user to Generate leave image | ||
* @param {string} background Background URL to Generate leave image | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async leave(username, avatar, background) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
@@ -1245,5 +1296,5 @@ if (!username) throw new SyntaxError("You are Missing the USERNAME") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/leaveimage?av=${avatar}&usernames=${username}&background=${background}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/leaveimage?av=${avatar}&usernames=${username}&background=${background}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1258,9 +1309,9 @@ }).catch(error => { | ||
/** | ||
* tweet | ||
* @param {String} avatar | ||
* @param {String} username | ||
* @param {String} text | ||
*/ | ||
tweet(avatar, username, text) { | ||
* Generates a Twitter Tweet. | ||
* @param {string} avatar Avatar URL to Generate Twitter Tweet | ||
* @param {string} username Username of the user to Generate Twitter Tweet | ||
* @param {string} text Text to Generate Twitter Tweet | ||
* @returns {Promise<Buffer>} | ||
*/ | ||
async tweet(avatar, username, text) { | ||
if (!avatar) throw new SyntaxError("You are Missing the AVATAR") | ||
@@ -1271,5 +1322,5 @@ if (!username) throw new SyntaxError("You are Missing the USERNAME") | ||
return new Promise((resolve, reject) => { | ||
fetch.get(encodeURI(`${base}/tweet?avatars=${avatar}&usernames=${username}&text=${text}&token=${this.token}`)).then((data) => { | ||
fetch(encodeURI(`${base}/tweet?avatars=${avatar}&usernames=${username}&text=${text}&token=${this.token}`)).then((data) => { | ||
//send data back | ||
resolve(data.raw) | ||
resolve(data.buffer()) | ||
return; | ||
@@ -1283,2 +1334,2 @@ }).catch(error => { | ||
} | ||
module.exports = Meme; | ||
module.exports = Meme; |
{ | ||
"name": "memer-api", | ||
"version": "3.0.6", | ||
"version": "4.0.0", | ||
"description": "An Image Manipulation API With More than 50+ commands", | ||
@@ -13,2 +13,3 @@ "main": "index.js", | ||
"discord.js": "^12.5.3", | ||
"node-fetch": "^2.6.1", | ||
"snekfetch": "^4.0.4" | ||
@@ -43,2 +44,2 @@ }, | ||
} | ||
} | ||
} |
39153
1155
3
5
61
+ Addednode-fetch@^2.6.1