Skip to content

Commit d77c4ea

Browse files
authored
Add files via upload
1 parent 1466cc3 commit d77c4ea

4 files changed

Lines changed: 89 additions & 0 deletions

File tree

docs/Welcome/started.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Documentation
2+
3+
Memer-API is a powerful module that allows you to manipulate images very easily.
4+
5+
6+
## Install the Api-Module:
7+
```npm install memer=api```
8+
9+
## Use the Api-Module
10+
```
11+
const Meme = require("memer-api");
12+
const memer = new Meme();
13+
14+
15+
//Little Example:
16+
const avatar = "https://imgur.com/I5DmdNR.png"; //only static images
17+
memer.dab(avatar).then(image => {
18+
//now you have a "BUFFER", for Discord create an attachment
19+
//const attachment = new Discord.MessageAttachment(image, "dab.png");
20+
//<Channel>.send(attachment)
21+
})
22+
```
23+

docs/Welcome/welcome.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Memer Api - Welcome
2+
3+
Memer API is a powerful module that allows you to manipulate images very easily.
4+
5+
6+
## **Installation**
7+
8+
Get in touch with memer-api, really fast and easy:
9+
10+
```
11+
npm install memer-api
12+
```
13+
14+
## First Use - with NODEJS
15+
16+
Once you installed the package, simply add it to your javascript File. Here an Example for nodejs
17+
18+
```
19+
const Meme = require("memer-api");
20+
const memer = new Meme();
21+
memer.<Method>(<Options>); //returns -> Promise -> <Buffer>
22+
```

docs/examples/examplebot.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//Import the Module directly, as with an forc ;) as well as discord.js and create a new client for discord bot & memer Bot
2+
const Meme = require("meme-api"),
3+
Discord = require("discord.js"),
4+
client = new Discord.Client(),
5+
memer = new Meme();
6+
7+
//login to the Discord Bot
8+
client.login("YOUR DISCORD BOT TOKEN GOES HERE");
9+
10+
//Read Event
11+
client.on("ready", () => {
12+
console.log("Memer is online!"); // eslint-disable-line no-console
13+
});
14+
15+
//Log Message
16+
client.on("message", (message) => {
17+
//if in a dm or msg from a bot, return
18+
if (!message.guild || message.author.bot) return;
19+
20+
const args = message.content.slice("!".length).split(" ");
21+
const cmd = args.shift().toLowerCase();
22+
//Example Command useage: !abandon <TEXT>
23+
if (cmd === "abandon") {
24+
if(!args[0]) return message.reply("Unknown useage, try this: `!abandon <TEXT>`");
25+
//create image and send it in the channel with the added arguments to the command
26+
memer.abandon(args.join(" ")).then(image => {
27+
const attachment = new Discord.MessageAttachment(image, "abandon.png");
28+
return message.channel.send(attachment);
29+
}).catch(e => {
30+
message.channel.send(String(e).substr(0, 2000), {code: "js"})
31+
})
32+
}
33+
34+
});

docs/index.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
- name: Welcome
2+
files:
3+
- name: General
4+
path: welcome.md
5+
- name: Getting started
6+
path: started.md
7+
- name: Examples
8+
files:
9+
- name: Example
10+
path: examplebot.js

0 commit comments

Comments
 (0)