UNPKG

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