Skip to content

Commit d968fd9

Browse files
authored
Release v3
2 parents a19ffcd + 3140e22 commit d968fd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4010
-353
lines changed

README.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,36 +78,36 @@ Remember to use `.build();` at the end to create the class.
7878

7979
### Auto Posting
8080
JavaBotBlockAPI allows you to post the guild counts automatically every X minutes.
81-
To do this, you first need to get an instance of the RequestHandler and then call `.startAutoPosting(...)`.
81+
To do this, you first need to get an instance of the PostAction and then call `.enableAutoPost(...)`.
8282

8383
Here is an example:
8484
```java
85-
RequestHandler handler = new RequestHandler();
85+
PostAction postAction = new PostAction();
8686

8787
// api is the instance of the BotBlockAPI
88-
handler.startAutoPosting(jda, api);
88+
postAction.enableAutoPost(jda, api);
8989
```
9090
The delay in which you post the guild counts is set through the `.setUpdateInterval(int)` method in the BotBlockAPI.Builder().
9191

9292
### Cancel auto posting
93-
To cancel the auto posting just call `.stopAutoPosting();` in the RequestHandler and it should cancel the scheduler.
93+
To cancel the auto posting just call `.disableAutoPost();` in the RequestHandler and it should cancel the scheduler.
9494

9595
### Manually posting
9696
There are methods that allow you to post the guild counts manually.
97-
To Post your guild counts, just call the `.postGuilds(..., ...)` method in the RequestHandler.
97+
To Post your guild counts, just call the `.postGuilds(...)` method in the PostAction.
9898

9999
```java
100-
RequestHandler handler = new RequestHandler();
100+
PostAction postAction = new PostAction();
101101

102102
// api is the instance of the BotBlockAPI
103-
handler.postGuilds(jda, api);
103+
postAction.postGuilds(jda, api);
104104
```
105105

106106
## GET methods
107-
Since version 2.0.0 of JavaBotBlockAPI can you get certain informations of a bot or the available Botlists on the BotBlock API.
107+
Since version 2.0.0 of JavaBotBlockAPI can you get certain information of a bot or the available Bot lists on the BotBlock API.
108108

109-
### All available Botlists
110-
You can call `.getBotlists()` to receive a JSONObject with all available Botlists in the BotBlockAPI.
109+
### All available Bot lists
110+
You can call `.getBotLists()` to receive a JSONObject with all available Botlists in the BotBlockAPI.
111111

112112
The returned JSONObject could look like this:
113113
```json
@@ -133,9 +133,9 @@ The returned JSONObject could look like this:
133133
}
134134
```
135135

136-
### Single Botlist
137-
Calling `.getBotlist(String)` returns a specific Botlist as JSONObject.
138-
For example does `.getBotlist("lbots.org")` return the following JSONObject:
136+
### Single Bot list
137+
Calling `.getBotList(String, Site|String)` returns a specific Botlist as JSONObject.
138+
For example does `.getBotList("123456789012345678", "lbots.org")` return the following JSONObject:
139139
```json
140140
{
141141
"api_docs": "https://lbots.org/api/docs",
@@ -148,7 +148,9 @@ For example does `.getBotlist("lbots.org")` return the following JSONObject:
148148
}
149149
```
150150

151-
### Complete Botinfo
151+
The first String parameter is used for the internal caching.
152+
153+
### Complete Bot info
152154
Calling `.getAll(...)` returns a JSONObject from all the botlists and with some general information.
153155

154156
The JSONObject can look like this:
@@ -176,10 +178,10 @@ The JSONObject can look like this:
176178
```
177179

178180
`{"data"}` is the JSON that is returned by the provided Botlist meaning it's different for each site.
179-
`name`, `owners`, `server_count` and `invite` is based on the most common appearances of the data.
181+
`name`, `discriminator`, `owners`, `server_count` and `invite` are based on the most common appearances of the data.
180182

181-
### Botinfo from all Botlists
182-
You can call `.getBotInfos(...)` to only receive the bot info from all the Botlists.
183+
### Bot info from all Bot lists
184+
You can call `.getBotListInfo(...)` to only receive the bot info from all the Botlists.
183185

184186
The returned JSONObject can look like this:
185187
```json
@@ -196,10 +198,18 @@ The returned JSONObject can look like this:
196198
```
197199
`{"data"}` is the JSON that is returned by the provided Botlist meaning it's different for each site.
198200

199-
### Botinfo of a single site
200-
With `.getBotInfo(..., String)` can you receive the info of a specific site.
201+
### Bot info of a single site
202+
With `.getBotListInfo(..., Site|String)` can you receive the info of a specific site.
201203
The returned data depends on the selected site and can be different for each one.
202204

205+
### Invite
206+
The method `getInvite(Long|String)` allows you to get the OAuth invite of the bot.
207+
The invite is based on the most common appearance on the different bot lists.
208+
209+
### Server count
210+
`.getServerCount(Long|String)` gives you the server count of the bot.
211+
The server count is based on the most common appearance on the different bot lists.
212+
203213
### Owners
204214
You can call `.getOwners(...)` to get the owners of a Bot from all the Botlists.
205215
The info is returned as ArrayList and is based on how often the info is provided by the botlists.

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ plugins{
77
}
88

99
group = 'com.andre601'
10-
version = '2.4.0'
10+
11+
version = '3.0.0'
1112

1213
sourceCompatibility = targetCompatibility = 1.8
1314

docs/allclasses-index.html

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (11.0.4) on Mon Sep 30 18:18:15 CEST 2019 -->
5+
<!-- Generated by javadoc (11.0.4) on Thu Nov 14 15:06:58 CET 2019 -->
66
<title>All Classes (JavaBotBlockAPI Javadocs)</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2019-09-30">
8+
<meta name="dc.created" content="2019-11-14">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
1111
<script type="text/javascript" src="script.js"></script>
@@ -28,7 +28,7 @@
2828
catch(err) {
2929
}
3030
//-->
31-
var data = {"i0":2,"i1":2,"i2":2,"i3":2,"i4":4};
31+
var data = {"i0":2,"i1":2,"i2":2,"i3":2,"i4":2,"i5":2,"i6":4};
3232
var tabs = {65535:["t0","All Classes"],2:["t2","Class Summary"],4:["t3","Enum Summary"]};
3333
var altColor = "altColor";
3434
var rowColor = "rowColor";
@@ -114,8 +114,7 @@ <h1 title="All&amp;nbsp;Classes" class="title">All&nbsp;Classes</h1>
114114
<tr id="i0" class="altColor">
115115
<td class="colFirst"><a href="com/andre601/javabotblockapi/BotBlockAPI.html" title="class in com.andre601.javabotblockapi">BotBlockAPI</a></td>
116116
<th class="colLast" scope="row">
117-
<div class="block">Class for handling the sites to post to and the delay for the auto-post option in the
118-
<a href="com/andre601/javabotblockapi/RequestHandler.html" title="class in com.andre601.javabotblockapi"><code>RequestHandler</code></a>.</div>
117+
<div class="block">Class used to define the auth-tokens used for the different sites.</div>
119118
</th>
120119
</tr>
121120
<tr id="i1" class="rowColor">
@@ -125,21 +124,33 @@ <h1 title="All&amp;nbsp;Classes" class="title">All&nbsp;Classes</h1>
125124
</th>
126125
</tr>
127126
<tr id="i2" class="altColor">
128-
<td class="colFirst"><a href="com/andre601/javabotblockapi/exceptions/RatelimitedException.html" title="class in com.andre601.javabotblockapi.exceptions">RatelimitedException</a></td>
127+
<td class="colFirst"><a href="com/andre601/javabotblockapi/requests/GetAction.html" title="class in com.andre601.javabotblockapi.requests">GetAction</a></td>
129128
<th class="colLast" scope="row">
130-
<div class="block">Used when the Wrapper gets ratelimited by the BotBlockAPI.</div>
129+
<div class="block">Class to perform GET actions with.</div>
131130
</th>
132131
</tr>
133132
<tr id="i3" class="rowColor">
134-
<td class="colFirst"><a href="com/andre601/javabotblockapi/RequestHandler.html" title="class in com.andre601.javabotblockapi">RequestHandler</a></td>
133+
<td class="colFirst"><a href="com/andre601/javabotblockapi/requests/PostAction.html" title="class in com.andre601.javabotblockapi.requests">PostAction</a></td>
135134
<th class="colLast" scope="row">
136-
<div class="block">Class to handle post-requests to the <a href="https://botblock.org" target="_blank">BotBlock API</a>.</div>
135+
<div class="block">Class to perform post actions with.</div>
137136
</th>
138137
</tr>
139138
<tr id="i4" class="altColor">
139+
<td class="colFirst"><a href="com/andre601/javabotblockapi/exceptions/RatelimitedException.html" title="class in com.andre601.javabotblockapi.exceptions">RatelimitedException</a></td>
140+
<th class="colLast" scope="row">
141+
<div class="block">Used when the Wrapper gets ratelimited by the BotBlockAPI.</div>
142+
</th>
143+
</tr>
144+
<tr id="i5" class="rowColor">
145+
<td class="colFirst"><a href="com/andre601/javabotblockapi/RequestHandler.html" title="class in com.andre601.javabotblockapi">RequestHandler</a></td>
146+
<th class="colLast" scope="row">Deprecated.
147+
<div class="deprecationComment">Use <a href="com/andre601/javabotblockapi/requests/PostAction.html" title="class in com.andre601.javabotblockapi.requests"><code>PostAction</code></a> or <a href="com/andre601/javabotblockapi/requests/GetAction.html" title="class in com.andre601.javabotblockapi.requests"><code>GetAction</code></a> respectively.</div>
148+
</th>
149+
</tr>
150+
<tr id="i6" class="altColor">
140151
<td class="colFirst"><a href="com/andre601/javabotblockapi/Site.html" title="enum in com.andre601.javabotblockapi">Site</a></td>
141152
<th class="colLast" scope="row">
142-
<div class="block">Enum class with all currently supported sites of BotBlock.org.</div>
153+
<div class="block">Enum class containing all sites currently supported by BotBlock.org.</div>
143154
</th>
144155
</tr>
145156
</table>

docs/allclasses.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (11.0.4) on Mon Sep 30 18:18:15 CEST 2019 -->
5+
<!-- Generated by javadoc (11.0.4) on Thu Nov 14 15:06:58 CET 2019 -->
66
<title>All Classes (JavaBotBlockAPI Javadocs)</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2019-09-30">
8+
<meta name="dc.created" content="2019-11-14">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
1111
<script type="text/javascript" src="script.js"></script>
@@ -24,6 +24,8 @@ <h1 class="bar">All&nbsp;Classes</h1>
2424
<ul>
2525
<li><a href="com/andre601/javabotblockapi/BotBlockAPI.html" title="class in com.andre601.javabotblockapi">BotBlockAPI</a></li>
2626
<li><a href="com/andre601/javabotblockapi/BotBlockAPI.Builder.html" title="class in com.andre601.javabotblockapi">BotBlockAPI.Builder</a></li>
27+
<li><a href="com/andre601/javabotblockapi/requests/GetAction.html" title="class in com.andre601.javabotblockapi.requests">GetAction</a></li>
28+
<li><a href="com/andre601/javabotblockapi/requests/PostAction.html" title="class in com.andre601.javabotblockapi.requests">PostAction</a></li>
2729
<li><a href="com/andre601/javabotblockapi/exceptions/RatelimitedException.html" title="class in com.andre601.javabotblockapi.exceptions">RatelimitedException</a></li>
2830
<li><a href="com/andre601/javabotblockapi/RequestHandler.html" title="class in com.andre601.javabotblockapi">RequestHandler</a></li>
2931
<li><a href="com/andre601/javabotblockapi/Site.html" title="enum in com.andre601.javabotblockapi">Site</a></li>

docs/allpackages-index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (11.0.4) on Mon Sep 30 18:18:15 CEST 2019 -->
5+
<!-- Generated by javadoc (11.0.4) on Thu Nov 14 15:06:58 CET 2019 -->
66
<title>All Packages (JavaBotBlockAPI Javadocs)</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2019-09-30">
8+
<meta name="dc.created" content="2019-11-14">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
1111
<script type="text/javascript" src="script.js"></script>
@@ -114,6 +114,10 @@ <h1 title="All&amp;nbsp;Packages" class="title">All&nbsp;Packages</h1>
114114
<th class="colFirst" scope="row"><a href="com/andre601/javabotblockapi/exceptions/package-summary.html">com.andre601.javabotblockapi.exceptions</a></th>
115115
<td class="colLast">&nbsp;</td>
116116
</tr>
117+
<tr class="altColor">
118+
<th class="colFirst" scope="row"><a href="com/andre601/javabotblockapi/requests/package-summary.html">com.andre601.javabotblockapi.requests</a></th>
119+
<td class="colLast">&nbsp;</td>
120+
</tr>
117121
</tbody>
118122
</table>
119123
</li>

docs/com/andre601/javabotblockapi/BotBlockAPI.Builder.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (11.0.4) on Mon Sep 30 18:18:15 CEST 2019 -->
5+
<!-- Generated by javadoc (11.0.4) on Thu Nov 14 15:06:58 CET 2019 -->
66
<title>BotBlockAPI.Builder (JavaBotBlockAPI Javadocs)</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2019-09-30">
8+
<meta name="dc.created" content="2019-11-14">
99
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
1010
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">
1111
<script type="text/javascript" src="../../../script.js"></script>
@@ -278,8 +278,8 @@ <h4>addAuthToken</h4>
278278
<dl>
279279
<dt><span class="paramLabel">Parameters:</span></dt>
280280
<dd><code>site</code> - The <a href="Site.html" title="enum in com.andre601.javabotblockapi"><code>Site</code></a> to get the name from.</dd>
281-
<dd><code>token</code> - The API token from the corresponding botlist. May not be null or empty.
282-
<br>You may receive the API token from the botlist.</dd>
281+
<dd><code>token</code> - The API token from the corresponding bot list. May not be null or empty.
282+
<br>You may receive the API token from the bot list.</dd>
283283
<dt><span class="returnLabel">Returns:</span></dt>
284284
<dd>The Builder after the site and token were set. Useful for chaining.</dd>
285285
<dt><span class="throwsLabel">Throws:</span></dt>
@@ -305,8 +305,8 @@ <h4>addAuthToken</h4>
305305
<dt><span class="paramLabel">Parameters:</span></dt>
306306
<dd><code>site</code> - The name of the site. May not be null.
307307
<br>A list of supported sites can be found <a href="https://botblock.org/api/docs#count" target="_blank">here</a>.</dd>
308-
<dd><code>token</code> - The API token from the corresponding botlist. May not be null or empty.
309-
<br>You may receive the API token from the botlist.</dd>
308+
<dd><code>token</code> - The API token from the corresponding bot list. May not be null or empty.
309+
<br>You may receive the API token from the bot list.</dd>
310310
<dt><span class="returnLabel">Returns:</span></dt>
311311
<dd>The Builder after the site and token were set. Useful for chaining.</dd>
312312
<dt><span class="throwsLabel">Throws:</span></dt>

0 commit comments

Comments
 (0)