1 | # Cafebot.js
|
2 |
|
3 | CAFEBOT.JS OFFICIAL WRAPPER
|
4 |
|
5 | [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/DopeDealers/Cafebot.js/graphs/commit-activity)
|
6 | [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
|
7 |
|
8 | [![forthebadge](https://forthebadge.com/images/badges/made-with-javascript.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/uses-badges.svg)](https://forthebadge.com)
|
9 |
|
10 | ## About
|
11 |
|
12 | This is a wrapper for the api of the bot named Cafe, visit or invite it [here](https://cafe.ajnicoloff.me/)
|
13 | this project will be maintained per every endpoint or bug found. please create an issue
|
14 | for us to track or fix.
|
15 |
|
16 | Join official Cafe Discord [here](https://discordapp.com/invite/DxP2He9)
|
17 |
|
18 | ## Installation
|
19 |
|
20 | **NPM**
|
21 | ``npm i cafebot.js``
|
22 |
|
23 | **Yarn**
|
24 | ``yarn add cafebot.js``
|
25 |
|
26 |
|
27 | ## Client
|
28 |
|
29 | The Client for connecting to the API:
|
30 |
|
31 | |Client |Options |
|
32 | |----------------|-------------------------------|
|
33 | |token |``'cafebot_token'`` |
|
34 | |disableLogs | ``true or false`` |
|
35 |
|
36 | **JS Setup**
|
37 | ```js
|
38 | const { Client } = require('cafebot.js');
|
39 |
|
40 | const c = new Client('token here');
|
41 | ```
|
42 |
|
43 | ## Get a user profile
|
44 |
|
45 | ```js
|
46 | // ES6 promise
|
47 | const { Client } = require('cafebot.js');
|
48 |
|
49 | const cafe = new Client('token here').profile('discorduserid');
|
50 |
|
51 | cafe.then(user => {
|
52 | console.log(user);
|
53 | //Will output all profile data
|
54 | });
|
55 | ```
|
56 |
|
57 | ## Check if a user has voted
|
58 |
|
59 | ```js
|
60 | // Asynchronous promise
|
61 | const {Client} = require('cafebot.js');
|
62 | // also removes logging
|
63 | const cafe = new Client('token here', {disableLogs: true});
|
64 |
|
65 | const Hello = await cafe.vote("discorduserid");
|
66 |
|
67 | console.log(Hello);
|
68 | //Will output a boolean, vote time, or an error.
|
69 | ```
|
70 |
|
71 | # There's more methods, but all of them follow the same style, and are appropriately not listed - for length purposes.
|
72 |
|
73 | ## Known Bugs
|
74 |
|
75 | | Client | |
|
76 | |-----------|-------------------------------------------------------------|
|
77 | |None! | | |
\ | No newline at end of file |