UNPKG

6.24 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 |
20| -------- | ------ | ----------- |
21| `birb()` | none | Sends a birb image |
22| `cats()` | none | Sends a cat image |
23| `dogs()` | none | Sends a dog image |
24| `sadcat()` | none | Sends a sad cat image |
25| `amiajoke()` | `image` | Am I A Joke Meme |
26| `bad()` | `image` | Show someone how bad they are |
27| `joke()` | `image` | r/wooosh |
28| `salty()` | `image` | Sends a salty image filter |
29| `blur()` | `image` | Sends a blur image filter |
30| `invert()` | `image` | Sends a inverted color image filter |
31| `bnw()` | `image` | Sends a black and white image filter |
32| `flip()` | `image` | Sends a the flipped version of the image |
33| `mirror()` | `image` | Sends a the mirrored version of the image |
34| `deepfry()` | `image` | Sends a deep fry image filter |
35| `pixelate()` | `image` | Sends a pixelated image filter |
36| `magik()` | `image` | Sends a magik image filter |
37| `jpegify()` | `image` | Turns image into jpeg |
38| `snow()` | `image` | Sends a snow image filter |
39| `gay()` | `image` | Sends a gay image filter |
40| `wide()` | `image` | Sends a wide Putin image filter |
41| `sepia()` | `image` | Sends a Sepia image filter |
42| `communist()` | `image` | Sends a communist image filter |
43| `what()` | `image` | Sends an Earthbound WHAT meme |
44| `shame()` | `image` | Sends you to the Dock of Shame |
45| `colorify()` | `image` `c(optional)` `b(optional)` | Sends a colorify image filter |
46| `floor()` | `image` `text` | The floor is lava |
47| `scroll()` | `text` | Sends the Scroll of Truth |
48| `facts()` | `text` | Sends the facts book |
49| `calling()` | `text` | Tom&Jerry Tom calling Meme image |
50| `captcha()` | `text` | Sends a Google Captcha image |
51| `fml()` | `text` | Sends a F*** my life quote |
52| `achievement()` | `text` `icon(optional)` | Sends a Minecraft Achievement image |
53| `challenge()` | `text` `icon(optional)` | Sends a Minecraft Challenge image |
54| `supreme()` | `text` `dark(optional)` `light(optional)` | Sends a Supreme image |
55| `didyoumean()` | `top` `bottom` | Google Did you mean? |
56| `drake()` | `top` `bottom` | Drake meme image |
57| `pornhub()` | `text` `text2` | Pornhub Logo image |
58| `ship()` | `user` `user2` | Ships 2 users |
59| `trash()` | `face` `trash` | Points out someone is trash |
60
61### Others
62| Function | Params | Description |
63| -------- | ------ | ----------- |
64| `color()` | `hex` | Searches a Color |
65
66Params such as:
67`image`,`user`,`user2`,`face`,`trash` requires Discord CDN and MEDIA URLs
68
69`dark`,`light` requires a boolean value formatted as a string (`"true"`,`"false"`)
70
71`icons` requires a number (int) value
72
73`text` requires strings
74
75All endpoints will return a `Buffer` except birb/cats/dogs/sadcat/color/fml
76
77`birb/cats/dogs/sadcat` will return a JSON `{file: "https://api.alexflipnote.dev/cats/zDm8l4maVQg_cats.png"}`
78
79`color` will return a JSON (example: [Color](https://github.com/HarutoHiroki/alexflipnote.js/blob/master/README.md#Color-Example))
80
81`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"}`
82
83## Typings
84I 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.
85
86## Examples
87### Cats Example
88```js
89const client = require('alexflipnote.js');
90const alexclient = new client('Your-API-Token-Here');
91
92let link = await alexclient.image.cats();
93message.channel.send({files: [{ attachment: link.file }]});
94
95```
96
97### Colorify Example
98```js
99const client = require('alexflipnote.js');
100const alexclient = new client('Your-API-Token-Here');
101
102let url = "https://cdn.discordapp.com/avatars/242263403001937920/37050aab01de8806e4bc1e2b83983439.webp?size=1024";
103
104let link = await alexclient.image.colorify({image: url, c: "00ffd9", b: "000000"});
105message.channel.send({files: [{ attachment: link }]});
106
107```
108
109### Color Example
110```js
111const client = require('alexflipnote.js');
112const alexclient = new client('Your-API-Token-Here');
113let body = await alexclient.others.color('00ffd9');
114message.channel.send(body);
115
116```
117returns:
118```cmd
119{
120 "blackorwhite_text": "#ffffff",
121 "brightness": 157,
122 "hex": "#00ffd9",
123 "image": "https://api.alexflipnote.dev/color/image/00ffd9",
124 "image_gradient": "https://api.alexflipnote.dev/color/image/gradient/00ffd9",
125 "int": 65497,
126 "name": "Bright Teal",
127 "rgb": "rgb(0, 255, 217)",
128 "rgb_values": {"r": 0, "g": 255, "b": 217},
129 "shade": ["00ffd9", "00e5c3", "00ccad", "00b297", "009982", "007f6c", "006556", "004c41", "00322b", "001915", "000000"],
130 "tint": ["00ffd9", "19ffdc", "33ffe0", "4cffe4", "66ffe8", "7fffec", "99ffef", "b2fff3", "ccfff7", "e5fffb", "FFFFFF"]
131}
132```
133
134# Made By
135This wrapper is made by HarutoHiroki#4000 on Discord.
136
137For questions and bug reports you can join [my server](https://discord.gg/sjtcnRb) or [AlexFlipnote's server](https://discord.gg/alexflipnote)
138
139Suggestions are welcomed!