Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twlite/dankmemer.js
An API wrapper for Dank Memer API.
https://github.com/twlite/dankmemer.js
api-wrapper dank dankmemer timeframe
Last synced: 5 days ago
JSON representation
An API wrapper for Dank Memer API.
- Host: GitHub
- URL: https://github.com/twlite/dankmemer.js
- Owner: twlite
- License: mit
- Created: 2020-01-18T07:46:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-05T20:20:31.000Z (about 4 years ago)
- Last Synced: 2024-10-27T21:57:41.098Z (17 days ago)
- Topics: api-wrapper, dank, dankmemer, timeframe
- Language: JavaScript
- Size: 30.3 KB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# DankMemer.js
An API wrapper for Dank Memer API.[![NPM](https://nodei.co/npm/dankmemer.png)](https://nodei.co/npm/dankmemer/)
# Installing
`npm i --save dankmemer`# Updates
- Fixed some bugs# Usage
```js
const DankMemer = require("dankmemer");
const memer = new DankMemer("Your API Token Goes Here");
```# Example
```js
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
- async-await
```js
async function spank(avatar1, avatar2) {
let img = await memer.spank(avatar1, avatar2);
message.channel.send({ file: img });
}
spank();
```- .then
```js
memer.spank(avatar1, avatar2).then(img => {
message.channel.send({ file: img });
})
```
# Getting API Key
Go to [dankmemer.services/dashboard](https://dankmemer.services/dashboard) and request for API key.# Functions
- abandon
- aborted
- affect
- airpods
- america
- armor
- balloon
- bed
- bongocat
- boo
- brain
- brazzers
- byemom
- cancer
- changemymind
- cheating
- citation
- communism
- confusedcat
- corporate
- crab
- cry
- dab
- dank
- deepfry
- delete
- disability
- doglemon
- door
- egg
- excuseme
- expanddong
- facts
- failure
- fakenews
- fedora
- floor
- fuck
- garfield
- gay
- goggles
- hitler
- humansgood
- inator
- invert
- jail
- justpretending
- kimborder
- knowyourlocation
- kowalski
- laid
- lick
- madethis
- magik
- master
- meme
- note
- nothing
- ohno
- piccolo
- plan
- presentation
- quote
- radialblur
- rip
- salty
- satan
- savehumanity
- screams
- shit
- sickban
- slap
- slapsroof
- sneakyfox
- spank
- stroke
- surprised
- sword
- thesearch
- trash
- tiger
- trigger
- tweet
- ugly
- unpopular
- violence
- violentsparks
- vr
- walking
- wanted
- wrap
- whodidthis
- whothisis
- yomomma
- youtube# 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:
- X-RateLimit-Limit: Maximum usage allowed per timeframe
- X-Ratelimit-Remaining: Remaining requests that can be made during the timeframe
- X-RateLimit-Reset: Timestamp indicating when the ratelimit will reset in milliseconds.
- Retry-After: Time to wait in milliseconds until another request can be made. Only exposed if ratelimit is reached.
- X-Global-RateLimit-Limit: Maximum global usage allowed per timeframe
- X-Global-Ratelimit-Remaining: Remaining requests that can be made globally during the timeframe
- X-Global-RateLimit-Reset: Timestamp indicating when the global ratelimit will resett in milliseconds.
- Retry-After: Time to wait in milliseconds until another request can be made. Only exposed if ratelimit is reached.# API Docs
**[Click Here](https://dankmemer.services/documentation)**# My GitHub
**[Click Here](https://github.com/INEX07)**