dankmemer.js

An API wrapper for Dank Memer API.


Project maintained by twlite Hosted on GitHub Pages — Theme by mattgraham

DankMemer.js

An API wrapper for Dank Memer API.

NPM

Installing

npm i --save dankmemer

Updates

Usage

const DankMemer = require("dankmemer");
const memer = new DankMemer("Your API Token Goes Here");

Example

const DankMemer = require("dankmemer");
const memer = new DankMemer("Dank Memer Api Key");
const Discord = require("discord.js");
const client = new Discord.Client();

client.on("ready", () => {
    console.log(`Memer is online!`);
});

client.on("message", async(message) => {
    if (!message.guild || message.author.bot) return;
    if (message.content === "spank") {
        let userone = message.author.displayAvatarURL;
        let usertwo = client.user.displayAvatarURL;
        let image = await memer.spank(userone, usertwo);

        const attachment = new Discord.Attachment(image, "spank.png")
        return message.channel.send(attachment);
    }
})

client.login("Discord Bot Token");

Methods

Functions

RateLimits [ Source: Dank Memer API ]

Rate Limits Each endpoint has it’s own ratelimit, which you can find in it’s documentation. Additionally, the API has a global ratelimit of 300 requests per minute.

The ratelimits for the endpoint are defined with X-RateLimit-:key, while the global ratelimit is defined with X-Global-RateLimit-:key. When the global ratelimit is hit, the body will contain an additional JSON key “global” which will be set to true.

Ratelimit Headers:

API Docs

Click Here

My GitHub

Click Here