UNPKG

6.07 kBMarkdownView Raw
1
2# Noodles wrapper [![npm](https://img.shields.io/npm/v/noodles-wrapper.svg)](https://www.npmjs.com/package/noodles-wrapper) [![npm](https://img.shields.io/npm/dt/noodles-wrapper.svg?maxAge=3600)](https://www.npmjs.com/package/noodles-wrapper) [![install size](https://packagephobia.now.sh/badge?p=noodles-wrapper)](https://packagephobia.now.sh/result?p=noodles-wrapper)
3
4
5
6An API wrapper for [Noodles API](https://frenchnoodles.xyz/api) made by French Noodles#6046 to make your life easier while using the noodles API
7 [![NPM](https://nodei.co/npm/noodles-wrapper.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/alexflipnote.js/)
8
9
10## Installation
11```
12npm i noodles-wrapper
13```
14
15## Examples
16### Random memes command, no input example
17```js
18const noodles_api = require('noodles-wrapper')
19const Discord = require('discord.js')
20
21const Image = await noodles_api.randommeme()
22let embed = new Discord.MessageEmbed()
23 .attachFiles([{name: "meme.png", attachment:Image}])
24 .setImage('attachment://meme.png')
25message.channel.send(embed)
26```
27
28### Lisa-Stage command, 1 text input example
29```js
30const noodles_api = require('noodles-wrapper')
31const Discord = require('discord.js')
32
33let text = args.toString().replace(/,/g, ' ')
34let Image = await noodles_api.lisastage(text)
35
36const attachment = new Discord.MessageAttachment(Image);
37message.channel.send(attachment);
38```
39
40### Drake command, more than one text input example
41```js
42const noodles_api = require('noodles-wrapper');
43
44let text1 = args.toString().split('/')[0].replace(/,/g, ' ')
45let text2 = args.toString().split('/')[1].replace(/,/g, ' ')
46
47let Image = await noodles_api.drake(text1, text2)
48const attachment = new Discord.MessageAttachment(Image);
49
50message.channel.send(attachment);
51```
52
53### Trash command, image input example
54```js
55let Discord = require("discord.js");
56const noodles_api = require('noodles-wrapper')
57
58let user = message.mentions.users.first() || message.author
59let result = user.displayAvatarURL()
60
61let Image = await noodles_api.trash(result)
62
63const attachment = new Discord.MessageAttachment(Image);
64message.channel.send(attachment);
65```
66
67### Balance card command, for more than 2 inputs example
68```js
69let Discord = require("discord.js");
70const noodles_api = require('noodles-wrapper')
71
72let Image = await new noodles_api.balancecard() //You first make the variable
73.setBackground(background) //then set all the arguments like so
74.setAvatar(avatar)
75.setTitle(title)
76.setText1(text1)
77.setText2(text2)
78.setTextColor(textcolor) //in hex
79.build() //and when your done, .build() it
80
81
82let embed= new Discord.MessageEmbed()
83 embed.setTitle(`Here is your balance ${message.author.username}!!`)
84 embed.attachFiles([{name: "balance.png", attachment:Image}])
85 embed.setImage('attachment://balance.png');
86 embed.setColor(process.env.EMBEDCOLOR)
87 embed.setFooter('Using Noodles API')
88message.channel.send(embed)
89```
90
91### Welcome banner
92As for the welcome banner, it the same code as balance card, just remove text1 replace text2 with subtitle, aka setSubtitle, like so:
93```js
94const noodles_api = require('noodles-wrapper')
95
96let Image = await new noodles_api.welcomebanner()
97.setBackground(background)
98.setAvatar(avatar)
99.setTitle(username)
100.setSubtitle(subtitle)
101.setTextColor(textcolor) //in hex
102.build()
103```
104
105## Endpoints
106You can get a full list of the possible API endpoints [Here](https://frenchnoodles.xyz/api/endpoints)
107But here are the functions:
108
109 - `drake(text1 ,text2)`
110 - `worthless(text)`
111 - `presidentialalert(text)`
112 - `spongebobburnpaper(text)`
113 - `lisastage(text)`
114 - `changemymind(text)`
115 - `awkwardmonkey(text)`
116 - `blur(image)`
117 - `invert(image)`
118 - `edges(image)`
119 - `circle(image)`
120 - `wide(image)`
121 - `uglyupclose(image)`
122 - `clown(image)`
123 - `rip(image)`
124 - `affectbaby(image)`
125 - `trash(image)`
126 - `welcomebanner() (set stuff like the example)`
127 - `boostercard(image)`
128 - `randommeme()`
129 - `balancecard() (set stuff like the example)`
130
131just replace the inputs with whatever you want,
132and for the "set stuff like example" just do as the example said at the start of the documentation
133
134## Quota
135Due to recent spamming incidents, quotas were added to stop the API from going down, down worry thoe!
136Its really subtle!
137
138### Free tier (default)
139- 1 request per second
140- 50 requests per hour
141- 250 requests per day
142
143### Hobby tier ($3)
144- 2 request per second
145- 80 requests per hour
146- 380 requests per day
147
148### Standard tier ($7) `most popular`
149- 3 request per second
150- 200 requests per hour
151- 800 requests per day
152
153To buy a tier, please contact me on discord [Here!](https://discord.gg/TnfeMrV)
154And if you want a better tier than **Standard** feel free to contact me too, we can arrange something
155
156### Error Handling
157Here is an example of an error you could get in your console if you passed the quota, feel free to error handle and make your bot send your own custom error
158```json
159{
160 'You have passed your default quota!': '1 per 1 second',
161 status: 429
162}
163```
164
165It is always recommended to handle the errors sent by wrapper, here is an example
166```js
167let Image
168try{
169 Image = await noodles_api.blur(result)
170} catch(err) {
171 return message.channel.send('You have been ratelimited (or there was a backend error)')
172}
173
174const attachment = new Discord.MessageAttachment(Image);
175message.channel.send(attachment);
176```
177
178### More tiers coming soon, if you have a big app and need it now, feel free to DM me on discord to discuss a price
179
180## Made by
181Made with ❤ by French Noodles#6046, you can checkout my website [Here](https://frenchnoodles.xyz) or join my discord server [Here!](https://frenchnoodles.xyz/discord) if you have any questions or suggestions or bug reports
182
183## Notes
184I will be adding the more complicated balance card and welcome endpoints
185
186Plus the wrapper is made in a way so that in Visual Studio Code you will get autocomplete for the function names!
187
188