UNPKG

6.75 kBMarkdownView Raw
1# alexflipnote.js [![npm](https://img.shields.io/npm/v/alexflipnote.js.svg)](https://www.npmjs.com/package/alexflipnote.js) [![npm](https://img.shields.io/npm/dt/alexflipnote.js.svg?maxAge=3600)](https://www.npmjs.com/package/alexflipnote.js) [![install size](https://packagephobia.now.sh/badge?p=alexflipnote.js)](https://packagephobia.now.sh/result?p=alexflipnote.js)
2A simple AlexFlipnote API Wrapper
3
4[![NPM](https://nodei.co/npm/alexflipnote.js.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/alexflipnote.js/)
5
6## Installation
7```
8npm i alexflipnote.js
9```
10
11## Tokens
12Since AlexFlipnote recently added an Authorization feature to the API, ALL previous versions of this wrapper will no longer work and are considered to be deprecated!
13
14Wondering how to get an Auth token to use your API ye? Well head on to https://discord.gg/DpxkY3x to request one.
15
16## Endpoints
17
18### Image
19| Function | Params | Description | Type |
20| -------- | ------ | ----------- | ---- |
21| `birb()` | none | Sends a random birb image | JSON |
22| `cats()` | none | Sends a random cat image | JSON |
23| `dogs()` | none | Sends a random dog image | JSON |
24| `sadcat()` | none | Sends a random sad cat image | JSON |
25| `coffee()` | none | Sends a random Coffee image | JSON |
26| `fml()` | none | Sends a random F*** my life quote | JSON |
27| `amiajoke()` | `image` | Am I A Joke Meme | Buffer |
28| `bad()` | `image` | Show someone how bad they are | Buffer |
29| `joke()` | `image` | r/wooosh | Buffer |
30| `salty()` | `image` | Sends a salty image filter | Buffer |
31| `blur()` | `image` | Sends a blur image filter | Buffer |
32| `invert()` | `image` | Sends a inverted color image filter | Buffer |
33| `bnw()` | `image` | Sends a black and white image filter | Buffer |
34| `flip()` | `image` | Sends a the flipped version of the image | Buffer |
35| `mirror()` | `image` | Sends a the mirrored version of the image | Buffer |
36| `deepfry()` | `image` | Sends a deep fry image filter | Buffer |
37| `pixelate()` | `image` | Sends a pixelated image filter | Buffer |
38| `magik()` | `image` | Sends a magik image filter | Buffer |
39| `jpegify()` | `image` | Turns image into jpeg | Buffer |
40| `snow()` | `image` | Sends a snow image filter | Buffer |
41| `gay()` | `image` | Sends a gay image filter | Buffer |
42| `wide()` | `image` | Sends a wide Putin image filter | Buffer |
43| `sepia()` | `image` | Sends a Sepia image filter | Buffer |
44| `communist()` | `image` | Sends a communist image filter | Buffer |
45| `what()` | `image` | Sends an Earthbound WHAT meme | Buffer |
46| `shame()` | `image` | Sends you to the Dock of Shame | Buffer |
47| `colorify()` | `image` `c(optional)` `b(optional)` | Sends a colorify image filter | Buffer |
48| `floor()` | `image` `text` | The floor is lava | Buffer |
49| `scroll()` | `text` | Sends the Scroll of Truth | Buffer |
50| `facts()` | `text` | Sends the facts book | Buffer |
51| `calling()` | `text` | Tom&Jerry Tom calling Meme image | Buffer |
52| `captcha()` | `text` | Sends a Google Captcha image | Buffer |
53| `achievement()` | `text` `icon(optional)` | Sends a Minecraft Achievement image | Buffer |
54| `challenge()` | `text` `icon(optional)` | Sends a Minecraft Challenge image | Buffer |
55| `supreme()` | `text` `dark(optional)` `light(optional)` | Sends a Supreme image | Buffer |
56| `didyoumean()` | `top` `bottom` | Google Did you mean? | Buffer |
57| `drake()` | `top` `bottom` | Drake meme image | Buffer |
58| `pornhub()` | `text` `text2` | Pornhub Logo image | Buffer |
59| `ship()` | `user` `user2` | Ships 2 users | Buffer |
60| `trash()` | `face` `trash` | Points out someone is trash | Buffer |
61
62### Others
63| Function | Params | Description | Type |
64| -------- | ------ | ----------- | ---- |
65| `color()` | `hex` | Searches a Color | JSON |
66
67Params such as:
68`image`,`user`,`user2`,`face`,`trash` requires Discord CDN and MEDIA URLs
69
70`dark`,`light` requires a boolean value formatted as a string (`"true"`,`"false"`)
71
72`icons` requires a number (int) value
73
74`text` requires strings
75
76All endpoints will return a `Buffer` except birb/cats/dogs/sadcat/coffee/fml/color, which will return a `JSON`
77
78`birb/cats/dogs/sadcat/coffee` will return a JSON `{file: "https://api.alexflipnote.dev/cats/zDm8l4maVQg_cats.png"}`
79
80`color` will return a JSON (example: [Color](https://github.com/HarutoHiroki/alexflipnote.js/blob/master/README.md#Color-Example))
81
82`fml` will return a JSON `{"text": "Today, I was running late for school and accidentally ran a red light and got pulled over. I couldn't find the registration and was freaking out, when the cop told me that he wouldn't give me a ticket if he could give me some advice. His advice? Don't wear your shirt inside-out. FML"}`
83
84## Typings
85I added a typings file and will be working to perfect it. This allows editors like VSC to use intellisense/autocomplete to suggest functions and help out with parameters and to see what you'll be receiving as a result of function calls.
86
87## Examples
88### Cats Example
89```js
90const client = require('alexflipnote.js');
91const alexclient = new client('Your-API-Token-Here');
92
93let link = await alexclient.image.cats();
94message.channel.send({files: [{ attachment: link.file }]});
95
96```
97
98### Colorify Example
99```js
100const client = require('alexflipnote.js');
101const alexclient = new client('Your-API-Token-Here');
102
103let url = "https://cdn.discordapp.com/avatars/242263403001937920/37050aab01de8806e4bc1e2b83983439.webp?size=1024";
104
105let link = await alexclient.image.colorify({image: url, c: "00ffd9", b: "000000"});
106message.channel.send({files: [{ attachment: link }]});
107
108```
109
110### Color Example
111```js
112const client = require('alexflipnote.js');
113const alexclient = new client('Your-API-Token-Here');
114let body = await alexclient.others.color('00ffd9');
115message.channel.send(body);
116
117```
118returns:
119```cmd
120{
121 "blackorwhite_text": "#ffffff",
122 "brightness": 157,
123 "hex": "#00ffd9",
124 "image": "https://api.alexflipnote.dev/color/image/00ffd9",
125 "image_gradient": "https://api.alexflipnote.dev/color/image/gradient/00ffd9",
126 "int": 65497,
127 "name": "Bright Teal",
128 "rgb": "rgb(0, 255, 217)",
129 "rgb_values": {"r": 0, "g": 255, "b": 217},
130 "shade": ["00ffd9", "00e5c3", "00ccad", "00b297", "009982", "007f6c", "006556", "004c41", "00322b", "001915", "000000"],
131 "tint": ["00ffd9", "19ffdc", "33ffe0", "4cffe4", "66ffe8", "7fffec", "99ffef", "b2fff3", "ccfff7", "e5fffb", "FFFFFF"]
132}
133```
134
135# Made By
136This wrapper is made by HarutoHiroki#4000 on Discord.
137
138For questions and bug reports you can join [my server](https://discord.gg/sjtcnRb) or [AlexFlipnote's server](https://discord.gg/alexflipnote)
139
140Suggestions are welcomed!