From f898648b5840380a68ddb5eed0bd72a0b325bf21 Mon Sep 17 00:00:00 2001 From: shinchanOP Date: Mon, 3 May 2021 17:19:49 +0530 Subject: [PATCH] UPDATE VERSION - 2.2.1 2 NEW ENDPOINTS --- .gitignore | 1 - README.md | 5 ++--- docs/Welcome/started.md | 23 ----------------------- docs/Welcome/welcome.md | 22 ---------------------- docs/examples/examplebot.js | 34 ---------------------------------- docs/index.yml | 10 ---------- lib/Meme.js | 36 ++++++++++++++++++++++++++++++++++++ package.json | 4 ++-- 8 files changed, 40 insertions(+), 95 deletions(-) delete mode 100644 .gitignore delete mode 100644 docs/Welcome/started.md delete mode 100644 docs/Welcome/welcome.md delete mode 100644 docs/examples/examplebot.js delete mode 100644 docs/index.yml diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3c3629e..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/README.md b/README.md index 6d0abd5..66fec5e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ Memer API is a powerful module that allows you to manipulate images very easily. - ## **Installation** ``` npm install memer-api @@ -28,7 +27,7 @@ const memer = new Meme(); memer.(); //returns -> Promise -> ``` -**Join our [Discord Server](https://discord.gg/pe3V7uT) for Support** +**Join our [Discord Server](https://discord.gg/emD44ZJaSA) for Support** **For more help view [Documentation ](https://memer-api.js.org)** @@ -63,7 +62,7 @@ memer.jail(avatar).then(jail=> { [WRAPPER BASED FROM SNOWFLAKES API WRAPPER](https://github.com/DevSnowflake/dankmemer.js#readme) -Made by: [@shinchanOP](https://github.com/shinchanOP), +Made by: [@shinchanOP](https://github.com/shinchanOP), Maintained by: [@Tomato6966](https://github.com/Tomato6966) & [@shinchanOP](https://github.com/shinchanOP) ## PREVIEWS diff --git a/docs/Welcome/started.md b/docs/Welcome/started.md deleted file mode 100644 index 59700b3..0000000 --- a/docs/Welcome/started.md +++ /dev/null @@ -1,23 +0,0 @@ -# Documentation - -Memer-API is a powerful module that allows you to manipulate images very easily. - - -## Install the Api-Module: -```npm install memer=api``` - -## Use the Api-Module -``` -const Meme = require("memer-api"); -const memer = new Meme(); - - -//Little Example: -const avatar = "https://imgur.com/I5DmdNR.png"; //only static images -memer.dab(avatar).then(image => { - //now you have a "BUFFER", for Discord create an attachment - //const attachment = new Discord.MessageAttachment(image, "dab.png"); - //.send(attachment) -}) -``` - diff --git a/docs/Welcome/welcome.md b/docs/Welcome/welcome.md deleted file mode 100644 index 1e8c170..0000000 --- a/docs/Welcome/welcome.md +++ /dev/null @@ -1,22 +0,0 @@ -# Memer Api - Welcome - -Memer API is a powerful module that allows you to manipulate images very easily. - - -## **Installation** - -Get in touch with memer-api, really fast and easy: - -``` -npm install memer-api -``` - -## First Use - with NODEJS - -Once you installed the package, simply add it to your javascript File. Here an Example for nodejs - -``` -const Meme = require("memer-api"); -const memer = new Meme(); -memer.(); //returns -> Promise -> -``` \ No newline at end of file diff --git a/docs/examples/examplebot.js b/docs/examples/examplebot.js deleted file mode 100644 index b29525c..0000000 --- a/docs/examples/examplebot.js +++ /dev/null @@ -1,34 +0,0 @@ -//Import the Module directly, as with an forc ;) as well as discord.js and create a new client for discord bot & memer Bot -const Meme = require("meme-api"), - Discord = require("discord.js"), - client = new Discord.Client(), - memer = new Meme(); - -//login to the Discord Bot -client.login("YOUR DISCORD BOT TOKEN GOES HERE"); - -//Read Event -client.on("ready", () => { - console.log("Memer is online!"); // eslint-disable-line no-console -}); - -//Log Message -client.on("message", (message) => { - //if in a dm or msg from a bot, return - if (!message.guild || message.author.bot) return; - - const args = message.content.slice("!".length).split(" "); - const cmd = args.shift().toLowerCase(); - //Example Command useage: !abandon - if (cmd === "abandon") { - if(!args[0]) return message.reply("Unknown useage, try this: `!abandon `"); - //create image and send it in the channel with the added arguments to the command - memer.abandon(args.join(" ")).then(image => { - const attachment = new Discord.MessageAttachment(image, "abandon.png"); - return message.channel.send(attachment); - }).catch(e => { - message.channel.send(String(e).substr(0, 2000), {code: "js"}) - }) - } - -}); \ No newline at end of file diff --git a/docs/index.yml b/docs/index.yml deleted file mode 100644 index 60aa90c..0000000 --- a/docs/index.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: Welcome - files: - - name: General - path: welcome.md - - name: Getting started - path: started.md -- name: Examples - files: - - name: Example - path: examplebot.js diff --git a/lib/Meme.js b/lib/Meme.js index c747793..6a4fb61 100644 --- a/lib/Meme.js +++ b/lib/Meme.js @@ -41,6 +41,42 @@ var Meme = /** @class */ (function () { }); }); }; + /** + * vr + * @param {String} avatar url to generate meme + */ + Meme.prototype.vr = function (text) { + if (!text) + throw new SyntaxError("You are Missing the AVATAR"); + return new Promise(function (resolve, reject) { + fetch.get(encodeURI(base + "/vr?text=" + text)).then(function (data) { + //send data back + resolve(data.raw); + return; + })["catch"](function (error) { + //if error reject the error + reject(error); + }); + }); + }; + /** + * search + * @param {String} avatar url to generate meme + */ + Meme.prototype.search = function (text) { + if (!text) + throw new SyntaxError("You are Missing the AVATAR"); + return new Promise(function (resolve, reject) { + fetch.get(encodeURI(base + "/isearch?text=" + text)).then(function (data) { + //send data back + resolve(data.raw); + return; + })["catch"](function (error) { + //if error reject the error + reject(error); + }); + }); + }; /** * trash * @param {String} avatar url to generate meme diff --git a/package.json b/package.json index da47389..0e994f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "memer-api", - "version": "2.1.4", + "version": "2.2.1", "description": "An Image Manipulation API With More than 50+ commands", "main": "index.js", "scripts": { @@ -16,7 +16,7 @@ "type": "git", "url": "git@github.com:shinchanOP/memer-api.git" }, - "homepage": "https://github.com/Milrato-Development", + "homepage": "https://github.com/Memer-Api", "keywords": [ "memerapi", "memer-api",